Skip to content

[codex] Capture VTEX newsletter opt-in#2

Merged
rockwellll merged 4 commits into
masterfrom
codex/vtex-newsletter-subscription-state
May 19, 2026
Merged

[codex] Capture VTEX newsletter opt-in#2
rockwellll merged 4 commits into
masterfrom
codex/vtex-newsletter-subscription-state

Conversation

@rockwellll
Copy link
Copy Markdown
Contributor

Summary

  • include VTEX orderForm newsletter opt-in as a positive subscription_state signal in Hellotext.identify payloads
  • cover funnel orderForm update handling, confirmation identify payloads, and extraction behavior
  • rebuild dist bundles

This branch also includes the existing local 1.0.4 commits that were ahead of origin/master.

Validation

  • npm run build
  • npm test -- --runInBand

@rockwellll rockwellll marked this pull request as ready for review May 19, 2026 12:13
@rockwellll rockwellll merged commit 6e76233 into master May 19, 2026
2 checks passed
@rockwellll rockwellll deleted the codex/vtex-newsletter-subscription-state branch May 19, 2026 12:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 194fc20d93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/utils.js
Comment on lines +15 to +16
if (preferences.optinNewsLetter === true) {
user.subscription_state = true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve the opt-in update after initial identify

When the shopper enters an email/phone before checking the newsletter box, the first funnel update identifies that same user without subscription_state; the later update reaches this new branch, but the bundled Hellotext SDK in dist/funnel.js returns early from identify when the remembered hello_user_id already matches the id, so this added field is never posted. This makes the common “enter identity, then opt in” flow fail to capture the opt-in unless the code forces a non-deduped update path.

Useful? React with 👍 / 👎.

Comment thread src/utils.js
Comment on lines 83 to 87
return {
reference: orderForm.orderGroup || orderForm.orderFormId,
amount: orderForm.value || 0,
currency: storeData.currencyCode,
source: "vtex",
delivery,
items,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep order totals in the tracked order payload

Both checkout.started and order.placed pass this object as object_parameters, but this return value now drops the top-level amount and currency that previously came from orderForm.value and storePreferencesData.currencyCode. As a result Hellotext receives item prices but no order total/currency, which breaks value attribution especially when the cart total differs from item sums due to discounts, shipping, or taxes; add source without removing the existing total fields.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant