XF 1.2 Google DFP custom targeting variables

kontrabass

Well-known member
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?
 
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");
 
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}");
 
Top Bottom