Question

I have seen examples of how to define which page certain ads display ('tag','accountants'), but what I want is to know the code that will dynamically pull the tag (or whatever I define) from the current url which I have targeted my display ad to from dfp. ('Tag','get-current-url')

I have over a thousand different tag pages on a database driven site and need to have certain ads served on certain tag pages.

I'm sure this is simple but having no luck finding what dfp JavaScript that needs to go into my site to pull add via url.

Was it helpful?

Solution

I wrote a jquery dfp plugin that allows you to do exactly this.

It allows you to target the domain, url and query parameters of the url.

Take a look at the Default targeting section on the github page, it sounds like you might want to use the inURL targeting... to do that you just need to add a new custom targeting string of inURL within the inventory section of the DFP admin and then you can set the Customised criteria in the ad targeting section of the line item and everything should just work... any questions let me know.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top