INN / doubleclick-for-wp

WordPress plugin for serving Google Ad Manager ads
https://wordpress.org/plugins/doubleclick-for-wp/
GNU General Public License v2.0
25 stars 11 forks source link

Targeting criteria for run of site campaigns #5

Closed aschweigert closed 7 years ago

aschweigert commented 8 years ago

per http://jira.inn.org/browse/HELPDESK-293, figure out what targeting criteria should be used to just backfill all empty spots that don't match any other targeting criteria

wjhdev commented 8 years ago

The quickest way to check the targeting that's set on a page is to look at the setTargeting param in the footer source. It's duplicated several times for different breakpoints, but should all be the same.

On a single page, for example:

if( (0 <= document.documentElement.clientWidth && document.documentElement.clientWidth < 769) ) { 
    jQuery('.dfw-phone').add('.dfw-all').dfp({ 
        dfpID: '1250449',
        refreshExisting: false,
        setTargeting: {"Page":["single"],"Category":["thepub"],"Tag":["all-things-considered","michael-oreskes","npr","podcasting"]}    });
} else if( (769 <= document.documentElement.clientWidth && document.documentElement.clientWidth < 980) ) { 
    jQuery('.dfw-tablet').add('.dfw-all').dfp({ 
        dfpID: '1250449',
        refreshExisting: false,
        setTargeting: {"Page":["single"],"Category":["thepub"],"Tag":["all-things-considered","michael-oreskes","npr","podcasting"]}    });
} else if( (980 <= document.documentElement.clientWidth && document.documentElement.clientWidth < 9999) ) { 
    jQuery('.dfw-desktop').add('.dfw-all').dfp({ 
        dfpID: '1250449',
        refreshExisting: false,
        setTargeting: {"Page":["single"],"Category":["thepub"],"Tag":["all-things-considered","michael-oreskes","npr","podcasting"]}    });
} 

Even with the category removed from the slug, "Category" should still be targeted correctly.

To target all spots, the targeting should just be "run of network" which is the default.

wjhdev commented 8 years ago

Oh, one more thing — if the targeting was setup just with inURL before, you'll have to set up another targeting criteria in dfp for "Category."

More instructions on that here: http://dfw.readthedocs.org/en/latest/Targeting/