-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add conditional tracking pixel #126
Conversation
UI bundle preview build successful! ✅ |
Antora site build successful! ✅ |
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.
From the discussion I would suggest moving to body-end-scripts but it's not a huge deal. Looks good otherwise!
@eric-schneider To answer your question, yep adding this to the partials will include it on every page as long as the |
UI bundle preview build successful! ✅ |
Antora site build successful! ✅ |
JIRA: DOC-4013
Resolves: #117
This PR adds a new partial,
tracking-pixel.hbs
, that implements a conditional tracking pixel with a variable ID. The tracking pixel code will only get built into pages when thesite.keys.scarf_tracking_pixel
key is defined in the playbook and assigned a value:See related playbook change.
From what I understand, tracking pixels are usually placed right before the closing
</body>
tag so that they don’t delay the loading of any visible content. For this reason, I've inserted thetracking-pixel
partial at the bottom ofbody.hbs
.@colegoldsmith, this ensures that the pixel will get included on every page, correct?
I've also seen it suggested that it's a good idea to hide the pixel with a CSS style so that the pixel doesn’t interact with other CSS on the page. For this reason, I've added
style="display:none
to the pixel.