Skip to content

[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

Open
wants to merge 76 commits into
base: latest
Choose a base branch
from

Conversation

elvinasv
Copy link
Member

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

  • A bullet point list of key code changes that have been made.

Developer Checklist

  • UX
    • UX Criteria met (visual UX & screenreader UX)
  • Accessibility
    • Accessibility Acceptance Criteria met
    • Accessibility swarm completed
    • Component Health updated
    • P1 accessibility bugs resolved
    • P2/P3 accessibility bugs planned (if not resolved)
  • Security
    • Security issues addressed
    • Threat Model updated
  • Documentation
    • Docs updated (runbook, READMEs)
  • Testing
    • Feature tested on relevant environments
  • Comms
    • Relevant parties notified of changes

Testing

  • Manual Testing required?
    • Local (Ready-For-Test, Local)
    • Test (Ready-For-Test, Test)
    • Preview (Ready-For-Test, Preview)
    • Live (Ready-For-Test, Live)
  • Manual Testing complete?
    • Local
    • Test
    • Preview
    • Live

Additional Testing Steps

  1. List the steps required to test this PR.

Useful Links

@elvinasv elvinasv self-assigned this Apr 14, 2025
Base automatically changed from WORLDSERVICE-492-CLICK to latest April 22, 2025 15:03
@elvinasv elvinasv marked this pull request as ready for review April 23, 2025 14:29
return;
}

(${processClientDeviceAndSendStaticBeacon.toString()})();
Copy link
Contributor

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...

Copy link
Contributor

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.

Copy link
Member Author

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 ? 🤔

Copy link
Contributor

@karinathomasbbc karinathomasbbc Apr 25, 2025

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.

Copy link
Member Author

@elvinasv elvinasv Apr 25, 2025

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:

  1. It creates the function and assigns it to the window, but does not invoke it.

  2. 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

return;
}

(${processClientDeviceAndSendStaticBeacon.toString()})();
Copy link
Member Author

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 ? 🤔

Copy link
Contributor

@karinathomasbbc karinathomasbbc left a 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! 🚢 🚢 🚢 🚢

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

Successfully merging this pull request may close these issues.

3 participants