-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
QuantcastId : Add support for firing pixel in quantcastIdSystem submodule #7107
Conversation
Fire pixel without measure
@sachinsurfs Could you provide a markdown file? |
Add a markdown file for the Quantcast Id System.
Hey @ncolletti - Done, I added a markdown file for the Quantcast Id System. |
modules/quantcastIdSystem.js
Outdated
// Callbacks on Event Listeners won't trigger if the event is already complete so this check is required | ||
if (document.readyState === 'complete') { | ||
firePixel(clientId, cookieExpDays); | ||
} | ||
window.addEventListener('load', function () { | ||
firePixel(clientId, cookieExpDays); | ||
}); |
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.
Should the firePixel callback within the load event be within the else block of the document.readyState? May help to prevent rare cases where both can fire as readyState is marked 'complete' right before the window 'load' event fires.
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.
Like you mentioned, it is pretty rare since they ideally must happen at the same time. Regardless, I added an else block to be safe.
@sachinsurfs Please add your userId config to userId.md |
There are tests failing on this PR, the first test within 'QuantcastId module' and four within the 'fire pixel' -- "quantcastIdSubmodule.findRootDomain is not a function". |
@ncolletti - Regarding failed tests, can you tell me the steps you took to reproduce those errors? I found that gulp and browserstack tests on my machine and circleci are passing. Testing on individual files like this -
This, however, wouldn't catch situations where the submodule genuinely couldn't inherit that function. Is there any fix you would suggest? Also, I see the CircleCI tests failing in another adaptor unrelated to this change. Do you know how I can resolve that? |
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.
LGTM
Type of change
Description of change
This introduces a callback function to send a pixel request to Quantcast servers once the document is loaded when the right configurations are provided and we have received the necessary consent. Please contact asig@quantcast.com for any issues.