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

Don't load pixel until load() is called on ad #147

Open
ericholscher opened this issue Mar 8, 2023 · 1 comment
Open

Don't load pixel until load() is called on ad #147

ericholscher opened this issue Mar 8, 2023 · 1 comment

Comments

@ericholscher
Copy link
Member

ericholscher commented Mar 8, 2023

Feedback from a user:

I see that a tracking pixel is loaded on the page (px.gif - twice) if theethicalads.min.js script is loaded onto the page, regardless of if there is a call to ethicalads.load() or not. I'm wondering if that might be messing with some of the metrics? As we discussed before, I don't load ads for anyone who has paid for a service / product from us, but I do have the ethicalads.min.js included on all pages, and then a bit of JS generated by PHP decides if ethicalads.load() should be run or not.

We can likely hook that logic into the ad display code, instead of being loaded when the JS is loaded, to avoid this. No reason to run extra logic if we can avoid it.

It looks like the logic should already be doing this, so guessing there's something else happening here:

ethical-ad-client/index.js

Lines 617 to 618 in 52906d5

if (index === 0 && placement && !force_load) {
placement.detectABP(ABP_DETECTION_PX, function (usesABP) {

@davidfischer
Copy link
Contributor

This is definitely not messing with our metrics or with what we report to the AcceptableAds folks. However, I'll review it to make sure it isn't doing anything unnecessary.

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

No branches or pull requests

2 participants