Skip to content

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

@ericholscher

Description

@ericholscher

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) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions