-
Notifications
You must be signed in to change notification settings - Fork 236
[WORLDSERVICE-643] Implement click tracking on Opera Mini for Canonical #12638
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
base: latest
Are you sure you want to change the base?
[WORLDSERVICE-643] Implement click tracking on Opera Mini for Canonical #12638
Conversation
…-click-tracking-opera-mini-canonical-work
…WORLDSERVICE-492-CLICK
…-click-tracking-opera-mini-canonical-work
src/app/components/ATIAnalytics/canonical/sendBeaconOperaMiniScript/index.ts
Outdated
Show resolved
Hide resolved
…WORLDSERVICE-492-CLICK
…-click-tracking-opera-mini-canonical-work
…rk' of github.com:bbc/simorgh into WORLDSERVICE-643-click-tracking-opera-mini-canonical-work
…-click-tracking-opera-mini-canonical-work
…WORLDSERVICE-492-CLICK
…WORLDSERVICE-643-click-tracking-opera-mini-canonical-work
…-click-tracking-opera-mini-canonical-work
…-click-tracking-opera-mini-canonical-work
src/app/components/ATIAnalytics/canonical/staticBeacon/index.ts
Outdated
Show resolved
Hide resolved
src/app/components/FrostedGlassPromo/__snapshots__/index.test.tsx.snap
Outdated
Show resolved
Hide resolved
return; | ||
} | ||
|
||
(${processClientDeviceAndSendStaticBeacon.toString()})(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if we need to check if it's on lite - because this will technically fire a page view on load, which we might not want to do on canonical...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is the case, then perhaps we're best moving it to the Lite Renderer instead of adding it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processClientDeviceAndSendStaticBeacon
only defines the beacon, but doesn't fire it on load. It is used by viewTracking
and clickTracking
Probably it could be renamed similar to addSendStaticBeaconToWindow
? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking more about this - processClientDeviceAndSendStaticBeacon
does send the beacon here:
window.sendStaticBeacon(`${atiURL}&${paramValues}`); |
I just want us to prove / double check that we're definitely not firing duplicate beacons - especially on opera mini on lite + canonical, because I am fairly sure in its original state, it was used to send the initial page view on lite, while the implementation in viewTracking + clickTracking was to fire the beacons for a component view/click respectively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Adding for traceability)
processClientDeviceAndSendStaticBeacon
does not send a beacon immediately when added:
-
It creates the function and assigns it to the window, but does not invoke it.
-
processClientDeviceAndSendStaticBeacon
only sends the beacon if atiURL is passed (e.g., by clickTracking and viewTracking).
There is a separation of concerns: CanonicalATIAnalytics handles page view tracking, while ComponentTracking handles component view and click tracking.
However as discussed, it would be a good idea to rename (e.g. addProcessClientDeviceAndSendStaticBeaconToWindow
) or refactor to extract parameter building logic from the sending of the beacon
…-click-tracking-opera-mini-canonical-work
src/app/components/FrostedGlassPromo/__snapshots__/index.test.tsx.snap
Outdated
Show resolved
Hide resolved
return; | ||
} | ||
|
||
(${processClientDeviceAndSendStaticBeacon.toString()})(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processClientDeviceAndSendStaticBeacon
only defines the beacon, but doesn't fire it on load. It is used by viewTracking
and clickTracking
Probably it could be renamed similar to addSendStaticBeaconToWindow
? 🤔
src/integration/pages/articles/gahuza/__snapshots__/canonical.test.js.snap
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, just a couple of minor things, otherwise good to go! 🚢 🚢 🚢 🚢
Resolves JIRA: https://jira.dev.bbc.co.uk/browse/WORLDSERVICE-643
Summary
A very high-level summary of easily-reproducible changes that can be understood by non-devs, and why these changes where made.
Code changes
Developer Checklist
Testing
Ready-For-Test, Local
)Ready-For-Test, Test
)Ready-For-Test, Preview
)Ready-For-Test, Live
)Additional Testing Steps
Useful Links