Issue with targeting ads on specific pages

Created on 25 July 2016, almost 8 years ago
Updated 13 March 2024, 3 months ago

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

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇸🇮Slovenia joco_sp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024