Skip to content
George Haberis edited this page Mar 27, 2023 · 11 revisions

Ophan (https://github.com/guardian/ophan) is the Guardian web analytics platform. Data from Ophan also goes into the Ophan Data Lake, along with many other sources of data.

How do we track component events?

We use a NPM module ophan-tracker-js that exposes an API for tracking various component events such as INSERT, VIEW, CLICK. Tracking these events gives us visibility on how users interact with our page. Each page view has a record within the PageView table in the Data Lake, and each page view record contains a record of component events recorded on that page view.

The helper module behaviour.ts exposes functions we can use to track these events.

What component events are we tracking?

πŸ“„ Page: Support Checkout

URL: https://support.theguardian.com/contribute

βš™οΈ Component: Stripe Payment Request Button

id action
StripePaymentRequestButton-PAY_NOW INSERT
StripePaymentRequestButton-GOOGLE_PAY INSERT
StripeApplePay-APPLE_PAY INSERT
StripePaymentRequestButton-PAY_NOW CLICK
StripePaymentRequestButton-GOOGLE_PAY CLICK
StripeApplePay-APPLE_PAY CLICK

βš™οΈ Component: Payment Method Selector

METHOD can be DirectDebit, Stripe, PayPal, Sepa, ExistingCard, ExistingDirectDebit or AmazonPay.

id action
payment-method-selector-[METHOD] INSERT
payment-method-selector-[METHOD] CLICK

βš™οΈ Component: Amazon Pay Modal

id action
amazon-pay-login-click CLICK
amazon-pay-login-loaded VIEW
amazon-pay-wallet-loaded VIEW

βš™οΈ Component: Paypal Recurring Submit Button

Triggered via the trackCheckoutSubmitAttempt function onClick.

id action
PayPal-ANNUAL-submit CLICK
PayPal-MONTHLY-submit CLICK

βš™οΈ Component: Recaptcha

id action
contributions-recaptcha-client-token-received VIEW

βš™οΈ Component: Amount button clicked

REGION can be AUDCountries, Canada, EURCountries, GBPCountries, International, NZDCountries or UnitedStates.

FREQUENCY can be ANNUAL, MONTHLY or ONE_OFF.

AMOUNT is a number or "other".

Example: npf-contribution-amount-toggle-AUDCountries-ANNUAL-120, npf-contribution-amount-toggle-AUDCountries-ANNUAL-other

id action
npf-contribution-amount-toggle-[REGION]-[FREQUENCY]-[AMOUNT] CLICK

βš™οΈ Component: Frequency tab clicked

REGION can be AUDCountries, Canada, EURCountries, GBPCountries, International, NZDCountries or UnitedStates.

FREQUENCY can be ANNUAL, MONTHLY or ONE_OFF.

Example: npf-contribution-type-toggle-AUDCountries-ANNUAL

id action
npf-contribution-type-toggle-[REGION]-[FREQUENCY] CLICK

βš™οΈ Component: Send to MMA link clicked on validation error for existing recurring contributors

id action
send-to-mma-already-contributor CLICK

βš™οΈ Component: Stripe 3ds Modal

id action
stripe-3ds VIEW
stripe-3ds-failure CLICK
stripe-3ds-success CLICK

βš™οΈ Component: Country Dropdown

REGION can be AUDCountries, Canada, EURCountries, GBPCountries, International, NZDCountries or UnitedStates.

Example: toggle_country: AUDCountries

id action
toggle_country: [REGION] CLICK

πŸ“„ Page: Contributions Thank You page

URL: https://support.theguardian.com/[uk|us|au|eu|int|nz|ca]/thankyou

id action
contribution-thankyou-aus-map VIEW
contribution-thankyou-aus-map CLICK
contribution-thankyou-read-more-sign-in CLICK
contribution-thankyou-return-to-guardian CLICK
contribution-thankyou-social VIEW
contribution-thankyou-social-email CLICK
contribution-thankyou-social-facebook CLICK
contribution-thankyou-social-linked-in CLICK
contribution-thankyou-social-twitter CLICK
contribution-thankyou-survey CLICK
contribution-thankyou-survey VIEW
marketing-permissions VIEW
marketing-permissions CLICK
reminder-test-link-clicked VIEW
reminder-test-link-clicked CLICK
set-password VIEW
sign-into-the-guardian-link CLICK
sign-into-the-guardian-link VIEW
supporter-plus-thankyou-app-store CLICK
supporter-plus-thankyou-google-play CLICK

πŸ™‹β€β™€οΈ General Information

🎨 Client-side 101

βš›οΈ React+Redux

πŸ’° Payment methods

πŸŽ› Deployment & Testing

πŸ“Š AB Testing

🚧 Helper Components

πŸ“š Other Reference

1️⃣ Quickstarts

πŸ›€οΈ Tracking

Clone this wiki locally