I am not able to show some ads on specific pages.

I want to show specific ads on specific pages. In my case I have multiple News content types that are also displayed on a landing page. I am able to show those specific ad on the landing page, but on on the node. On nodes the ads are showing, but not the one I want.
I added this target value with [current-page:url:args:value:0]

The landing page has the URL example.com/news the URL-s of the nodes are created by Pathauto and are example.com/news/title-of-news. In the head the javascript looks OK and the targets looks ok too, but I can't figure out why the ads are showing on the landing page and not also on nodes.

The code in the head:

<script type="text/javascript">
  
  googletag.slots["gow_300x100_1"] = googletag.defineSlot("/[network:code]/[network:code]/GOW_300x100", [300, 100], "js-dfp-tag-gow_300x100_1")

    .addService(googletag.pubads())

  
  

      .setTargeting('ct_types', ['news'])
      ;
</script>

Also when I use hook_dfp_target_alter(&$targeting), I can see the targeting tags that I want to use on that nodes.

I am using Pathauto, Context

Comments

joco_sp created an issue.

Anybody’s picture

@joco_sp is your issue perhaps also related to the double slash in the beginning? See #3427653: Duplicate starting slash in front of network ID or wrong description leads to broken targeting

But in my case it is 2.x