Skip to content
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

CommercialMetrics includes ad blocker use #24191

Merged
merged 7 commits into from
Sep 23, 2021

Conversation

zekehuntergreen
Copy link
Contributor

@zekehuntergreen zekehuntergreen commented Sep 22, 2021

What does this change?

  • Upgrade to newest version of commercial-core, which includes a change to sendCommercialMetrics so that it accepts an optional parameter adBlockerInUse
  • Pass the new parameter to sendCommercialMetrics
  • Small fix to detectAdblock so that window.guadian.adBlockers.active is always a boolean or undefined. Before the change, it's value could be undefined, true, false, or empty string.

Does this change need to be reproduced in dotcom-rendering ?

Screenshots

N/A

What is the value of this and can you measure success?

We'd like to collect data on our readers' use of ad blockers

Checklist

Does this affect other platforms?

  • AMP
  • Apps
  • Other (please specify)

Does this affect GLabs Paid Content Pages? Should it have support for Paid Content?

  • No
  • Yes (please give details)

Does this change break ad-free?

  • No
  • It did, but tests caught it and I fixed it
  • It did, but there was no test coverage so I added that then fixed it

Does this change update the version of CAPI we're using?

Accessibility test checklist

Tested

  • Locally
  • On CODE (optional)

Copy link
Contributor

@mxdvl mxdvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d like this to be a little more robust. Relying on the shape of the window object, which we declare in a gobal.d.ts file, feels a little brittle.

Copy link
Contributor

@mxdvl mxdvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoying that the TS check doesn’t pass.

};

confiant?: Confiant;

googletag?: googletag.Googletag;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the typescript errors in static/src/javascripts/projects/commercial/modules/dfp/prepare-googletag.ts

@zekehuntergreen zekehuntergreen merged commit adedd97 into main Sep 23, 2021
@zekehuntergreen zekehuntergreen deleted the adblocker-usage-in-commercial-metrics branch September 23, 2021 11:17
@prout-bot
Copy link
Collaborator

Seen on PROD (merged by @zekehuntergreen 11 hours, 49 minutes and 46 seconds ago)

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

Successfully merging this pull request may close these issues.

3 participants