Ophan - guardian/support-frontend GitHub Wiki
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_facing_up: Page: Support Checkout
URL: https://support.theguardian.com/contribute
:gear: 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 |
:gear: 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 |
:gear: Component: Amazon Pay Modal
| id | action |
|---|---|
| amazon-pay-login-click | CLICK |
| amazon-pay-login-loaded | VIEW |
| amazon-pay-wallet-loaded | VIEW |
:gear: Component: Paypal Recurring Submit Button
Triggered via the trackCheckoutSubmitAttempt function onClick.
| id | action |
|---|---|
| PayPal-ANNUAL-submit | CLICK |
| PayPal-MONTHLY-submit | CLICK |
:gear: Component: Recaptcha
| id | action |
|---|---|
| contributions-recaptcha-client-token-received | VIEW |
:gear: 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 |
:gear: 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 |
:gear: Component: Send to MMA link clicked on validation error for existing recurring contributors
| id | action |
|---|---|
| send-to-mma-already-contributor | CLICK |
:gear: Component: Stripe 3ds Modal
| id | action |
|---|---|
| stripe-3ds | VIEW |
| stripe-3ds-failure | CLICK |
| stripe-3ds-success | CLICK |
:gear: 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_facing_up: 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 |