[codex] Capture VTEX newsletter opt-in#2
Conversation
There was a problem hiding this comment.
💡 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".
| if (preferences.optinNewsLetter === true) { | ||
| user.subscription_state = true; |
There was a problem hiding this comment.
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 👍 / 👎.
| return { | ||
| reference: orderForm.orderGroup || orderForm.orderFormId, | ||
| amount: orderForm.value || 0, | ||
| currency: storeData.currencyCode, | ||
| source: "vtex", | ||
| delivery, | ||
| items, |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
This branch also includes the existing local 1.0.4 commits that were ahead of origin/master.
Validation