Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ab-test: contributions-only tracking passes through landings to checkout, one-time-checkout & thankyou #6698

Merged
merged 16 commits into from
Jan 17, 2025

Conversation

paul-daniel-dempsey
Copy link
Contributor

@paul-daniel-dempsey paul-daniel-dempsey commented Jan 16, 2025

What are you doing in this PR?

Pageview tracking added to generic checkout and one-time checkout

Trello Card

How to test

Set abDefinition.ts:ab-contributionsOnly test visibiility to true
https://support.thegulocal.com/int/contribute?country=lb#ab-contributionsOnly=control
https://support.thegulocal.com/int/contribute?country=lb#ab-contributionsOnly=variant

Screenshots

test landing one-time-checkout checkout
control image image image
variant image image image

@paul-daniel-dempsey paul-daniel-dempsey changed the title feat: test tracking added to checkout and one-time-checkout abtest: tracking added to checkout and one-time-checkout Jan 16, 2025
Copy link
Contributor

github-actions bot commented Jan 16, 2025

Size Change: +70 B (0%)

Total Size: 2.39 MB

ℹ️ View Unchanged
Filename Size Change
./public/compiled-assets/javascripts/[countryGroupId]/events/router.js 90.5 kB +17 B (+0.02%)
./public/compiled-assets/javascripts/[countryGroupId]/lazyRouter.js 93.3 kB +15 B (+0.02%)
./public/compiled-assets/javascripts/[countryGroupId]/router.js 259 kB +3 B (0%)
./public/compiled-assets/javascripts/ausMomentMap.js 108 kB +1 B (0%)
./public/compiled-assets/javascripts/contributionsRedirectStyles.js 20 B 0 B
./public/compiled-assets/javascripts/digitalSubscriptionLandingPage.js 228 kB +4 B (0%)
./public/compiled-assets/javascripts/downForMaintenancePage.js 67.7 kB 0 B
./public/compiled-assets/javascripts/error404Page.js 67.6 kB 0 B
./public/compiled-assets/javascripts/error500Page.js 67.5 kB 0 B
./public/compiled-assets/javascripts/favicons.js 617 B 0 B
./public/compiled-assets/javascripts/paperSubscriptionCheckoutPage.js 166 kB -1 B (0%)
./public/compiled-assets/javascripts/paperSubscriptionLandingPage.js 88 kB +10 B (+0.01%)
./public/compiled-assets/javascripts/payPalErrorPage.js 66.1 kB 0 B
./public/compiled-assets/javascripts/payPalErrorPageStyles.js 20 B 0 B
./public/compiled-assets/javascripts/promotionTerms.js 73.9 kB +11 B (+0.01%)
./public/compiled-assets/javascripts/subscriptionsLandingPage.js 73.2 kB +11 B (+0.02%)
./public/compiled-assets/javascripts/subscriptionsRedemptionPage.js 118 kB -3 B (0%)
./public/compiled-assets/javascripts/supporterPlusLandingPage.js 227 kB -2 B (0%)
./public/compiled-assets/javascripts/unsupportedBrowserStyles.js 20 B 0 B
./public/compiled-assets/javascripts/weeklySubscriptionCheckoutPage.js 163 kB -1 B (0%)
./public/compiled-assets/javascripts/weeklySubscriptionLandingPage.js 88.1 kB +7 B (+0.01%)
./public/compiled-assets/webpack/136.js 2.17 kB 0 B
./public/compiled-assets/webpack/186.js 3.35 kB 0 B
./public/compiled-assets/webpack/187.js 21.8 kB -2 B (-0.01%)
./public/compiled-assets/webpack/3.js 19.2 kB 0 B
./public/compiled-assets/webpack/311.js 40.1 kB 0 B
./public/compiled-assets/webpack/344.js 2 kB 0 B
./public/compiled-assets/webpack/397.js 10.2 kB 0 B
./public/compiled-assets/webpack/426.js 41 kB 0 B
./public/compiled-assets/webpack/643.js 22.4 kB 0 B
./public/compiled-assets/webpack/706.js 107 kB 0 B
./public/compiled-assets/webpack/754.js 9.98 kB 0 B
./public/compiled-assets/webpack/847.js 26 kB 0 B
./public/compiled-assets/webpack/checkout.js 14.3 kB 0 B
./public/compiled-assets/webpack/GuardianAdLiteLanding.js 9.09 kB 0 B
./public/compiled-assets/webpack/oneTimeCheckout.js 9.97 kB 0 B
./public/compiled-assets/webpack/ThankYou.js 1.07 kB 0 B

compressed-size-action

@paul-daniel-dempsey paul-daniel-dempsey changed the title abtest: tracking added to checkout and one-time-checkout ab-test: tracking added to checkout and one-time-checkout Jan 16, 2025
@paul-daniel-dempsey paul-daniel-dempsey force-pushed the pd/abtest-generic-checkouts-enable branch from 217cef4 to b2aa097 Compare January 16, 2025 12:35
@GHaberis
Copy link
Contributor

GHaberis commented Jan 16, 2025

@paul-daniel-dempsey do we not need to pass the selectedAmountsVariant in the abtestInitalizerData here: https://github.com/guardian/support-frontend/blob/main/support-frontend/assets/helpers/page/page.ts#L32 still?

I believe this is necessary in order for the ab test initialisation to know whether a user is paricipating the "Contributions Only" amounts test on pages that don't use Redux, such as the generic checkout and one-time-checkout?

Without this change a user in the the "Contributions Only" amounts test won't be allocated the contributinsOnly AB test on the generic checkout and one-time-checkout, we can validate this by checking the Ophan abTestRegister tracking event and the payload when we submit the form.

@paul-daniel-dempsey paul-daniel-dempsey changed the title ab-test: tracking added to checkout and one-time-checkout ab-test: tracking passes through to checkout, one-time-checkout & thankyou Jan 16, 2025
@paul-daniel-dempsey paul-daniel-dempsey changed the title ab-test: tracking passes through to checkout, one-time-checkout & thankyou ab-test: test tracking passes through to checkout, one-time-checkout & thankyou Jan 16, 2025
@paul-daniel-dempsey paul-daniel-dempsey changed the title ab-test: test tracking passes through to checkout, one-time-checkout & thankyou ab-test: contributions-only tracking passes through landings to checkout, one-time-checkout & thankyou Jan 16, 2025
@GHaberis
Copy link
Contributor

@paul-daniel-dempsey do we not need to pass the selectedAmountsVariant in the abtestInitalizerData here: https://github.com/guardian/support-frontend/blob/main/support-frontend/assets/helpers/page/page.ts#L32 still?
I believe this is necessary in order for the ab test initialisation to know whether a user is paricipating the "Contributions Only" amounts test on pages that don't use Redux, such as the generic checkout and one-time-checkout?
Without this change a user in the the "Contributions Only" amounts test won't be allocated the contributinsOnly AB test on the generic checkout and one-time-checkout, we can validate this by checking the Ophan abTestRegister tracking event and the payload when we submit the form.

@GHaberis I think the way Tom did this, by passing through and saving abParticipation in session storage, have done in both Landing pages, this ensures the checkout and one-time-checkout can access 'ab-contributionsOnly' test. Have tested this as you suggest above and it is in the checkout Ophan abTestRegister and passed through in the create (and in the thankyou Ophan abTestRegister).

Ah yes I see how the session storage would mean the participation is tracked on the checkouts although I have a feeling my PR here will stop it working! #6691 😆, lets discuss after stand-up tomorrow.

@paul-daniel-dempsey
Copy link
Contributor Author

paul-daniel-dempsey commented Jan 16, 2025

@paul-daniel-dempsey do we not need to pass the selectedAmountsVariant in the abtestInitalizerData here: https://github.com/guardian/support-frontend/blob/main/support-frontend/assets/helpers/page/page.ts#L32 still?
I believe this is necessary in order for the ab test initialisation to know whether a user is paricipating the "Contributions Only" amounts test on pages that don't use Redux, such as the generic checkout and one-time-checkout?
Without this change a user in the the "Contributions Only" amounts test won't be allocated the contributinsOnly AB test on the generic checkout and one-time-checkout, we can validate this by checking the Ophan abTestRegister tracking event and the payload when we submit the form.

@GHaberis I think the way Tom did this, by passing through and saving abParticipation in session storage, have done in both Landing pages, this ensures the checkout and one-time-checkout can access 'ab-contributionsOnly' test. Have tested this as you suggest above and it is in the checkout Ophan abTestRegister and passed through in the create (and in the thankyou Ophan abTestRegister).

Ah yes I see how the session storage would mean the participation is tracked on the checkouts although I have a feeling my PR here will stop it working! #6691 😆, lets discuss after stand-up tomorrow.

Yes, your right, perhaps not best option to rely on session storage especially if can switch it off in future (for regions chnages for example). I think ensuring the abTest initialization has the testAmountsVariant and checking for its existance should go back in. Made those changes now.

@paul-daniel-dempsey paul-daniel-dempsey force-pushed the pd/abtest-generic-checkouts-enable branch from 2924066 to 44180d3 Compare January 16, 2025 21:16
@paul-daniel-dempsey paul-daniel-dempsey force-pushed the pd/abtest-generic-checkouts-enable branch from cd9fbfc to c18fd57 Compare January 16, 2025 21:18
@paul-daniel-dempsey paul-daniel-dempsey requested a review from a team January 16, 2025 21:21
Copy link
Contributor

@GHaberis GHaberis left a comment

Choose a reason for hiding this comment

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

Nice 👍

@paul-daniel-dempsey paul-daniel-dempsey merged commit 33ba1f5 into main Jan 17, 2025
19 checks passed
@paul-daniel-dempsey paul-daniel-dempsey deleted the pd/abtest-generic-checkouts-enable branch January 17, 2025 13:57
@prout-bot
Copy link

Seen on PROD (merged by @paul-daniel-dempsey 9 minutes and 13 seconds ago)

Sentry Release: support-client-side, support

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

Successfully merging this pull request may close these issues.

3 participants