-
Notifications
You must be signed in to change notification settings - Fork 230
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
Lite ATI Analytics script #12053
Lite ATI Analytics script #12053
Conversation
{isLite && addLiteScript(atiPageViewUrlString)} | ||
{!isLite && addOperaMiniExtremeScript(atiPageViewUrlString)} |
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 out loud here... what happens if the user views the lite site on opera mini? 😰
I think we're OK, but just wanted to check.
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.
It should be ok. The Lite script is basically identical to the Opera Mini script, so they'll get the same behaviour.
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.
And there's no danger of analytics being sent twice?
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.
This may be something we'll need to test on Opera Mini.
It was hard to diagnose at the time with the duplicate events, but my theory was that React hydration played a part with react-helmet. The way it behaves is it renders on the server once, then remounts the <Helmet>
tags again on hydration. Lite skips out hydration, so in theory it shouldn't.
Its just hard to know how Opera Mini servers behave with this though.
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.
We could literally do the exact same thing as we've done with Opera Mini and track if its been sent already in the window
object. I don't think there is a problem with that on Lite, so maybe to be absolutely sure, we just copy the Opera Mini implementation?
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.
Yeah that would work. I had thought that we might be able to consolidate both opera mini & lite implementations into a single script, but I think that would make things too complicated (and it is already complicated enough! 😰 )
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.
Yea I'd prefer to keep them separate even if they're almost the same. The Lite version may be extended in the future to handle click events too.
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.
Nice!
Resolves https://jira.dev.bbc.co.uk/browse/WSTEAM1-1420
Overall changes
noscript
tracking pixel in that instanceTesting
noscript
tracking pixelHelpful Links
Add Links to useful resources related to this PR if applicable.
Coding Standards
Repository use guidelines