• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Google DFP custom targeting variables

kontrabass

Well-known member
#1
In vbulletin I used the following to target DFP campaigns to forums and usergroups:
Code:
googletag.pubads().setTargeting("forumid", "$forumid");
googletag.pubads().setTargeting("usergroup", "$bbuserinfo[usergroupid]");
Is there an equivalent in xenforo?
 

kontrabass

Well-known member
#3
I guess within nodes. Ideally so that if someone wants to target a campaign to our "Amps" forum, I can do that within DFP by referencing the node id from XenForo (rather than generating a new ad code in DFP and adding conditionals in XenForo for each forum targeted campaign). Not sure if it's as simple as
Code:
googletag.pubads().setTargeting("forumid", "$nodeid");
 

kontrabass

Well-known member
#6
For future reference for others: If you're using Google DFP and want to target campaigns to specific forums, here's the correct syntax calling the xenforo forum.node_id variable:

Code:
googletag.pubads().setTargeting("forumid", "{$forum.node_id}");