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

DFP Integration into Xenforo

Includes targeting nodes, responsive ads, and adblock detection.

  1. AzzidReign

    AzzidReign Well-Known Member

    AzzidReign submitted a new resource:

    DFP Integration into Xenforo - Includes targeting nodes, responsive ads, and adblock detection.

    Read more about this resource...
    upnet, Andy.N, Bram and 1 other person like this.
  2. AzzidReign

    AzzidReign Well-Known Member

    I've been trying to think of additional ways we can utilize Custom Criteria to give our advertisers the ability to target just about anything. So here's a list of a few things that I think we can properly target and utilize:

    Parent + sibling forums
    googletag.pubads().setTargeting("parentid", "{$forum.parent_node_id}");
    Pretty much same concept as the forumid.

    Target thread:
    googletag.pubads().setTargeting("threadid", "{$thread.thread_id}");
    You'd follow the same concept as the forumid part of the guide.

    googletag.pubads().setTargeting("gender", "{$visitor.gender}");
    Instead of free-form, you can use the other option and define the values. For xenforo, there are 3 options for gender that you will have to enter.

    googletag.pubads().setTargeting("age", "{$user.age}");
    I'm not sure about this code. I can't seem to find any information on this anywhere. I have a feeling this is incorrect. Would $visitor.age work?

    I'm working on potentially targeting custom fields, but we'll see. Most people likely won't need most of this stuff but I'm hoping to have it all compiled in this one thread in the event an advertiser does request one of these.
    Breixo likes this.
  3. AzzidReign

    AzzidReign Well-Known Member

    After running this for a few days, I've decided to remove the adblock detection as it appears those who use adblock won't click ads so it shot my CTR down drastically, which in turn, dropped my CPM/RPM down to about 50% that it was at.

    Something I was also thinking about with targeting...if you wanted to target a specific usergroup (say...a CPM network just for your users), you could easily follow the same code scheme and usergroup ID as the above examples.
  4. RoldanLT

    RoldanLT Well-Known Member

    You have the point (y)
    AzzidReign likes this.
  5. Bram

    Bram Well-Known Member

    @AzzidReign are you using the build in adsense option in DFP or are you actually adding Adsense code as the creative?

    I am asking as i can't get my text ads to look in the way I want. Kinda addicted to the new Roboto look and adsense in DFP is showing like its still 1983.
  6. AzzidReign

    AzzidReign Well-Known Member

    I do both. I like to do split testing with colors.
    Bram likes this.
  7. AzzidReign

    AzzidReign Well-Known Member

    So something I'm thinking about doing is removing the whole AdBlock warning message. For guests, it would show as a message to register. For members, it will be asking them to become a premium member. Rather than bringing attention that the alert is there because of adblock and then the user disabling AdBlock dropping my CTR/RPM.
    valdet, jeffwidman and RoldanLT like this.
  8. RoldanLT

    RoldanLT Well-Known Member

    I don't have premium membership.
    But for adblock detector it helps me encouraging guest to register ;)
  9. SatGuyScott

    SatGuyScott Active Member

    I have run the adblock detector and I am starting to think that Google Adsense does not like it, as when the adblock detector is on my earnings take a big dip, when I turn it off the earnings go back up again. The number of ad views are about the same no matter if the adbock detector is on or off.

    Has anyone else noticed this or is it just me?
    newbornhero likes this.
  10. AzzidReign

    AzzidReign Well-Known Member

    Yes, that's why I have stated I've disabled it for the time being. I wonder what the correlation is. I thought it had to do with members or guests on the site that have ABP and disable it, but then don't click any ads, thus dropping CTR and RPM.
  11. kontrabass

    kontrabass Well-Known Member

    This is excellent :) I'm trying to figure out how to target ads to a category node... do you have any tips? Thanks for the awesome tips and guide!
  12. AzzidReign

    AzzidReign Well-Known Member

    I think there is a code for this but I can't look it up right now.
    RoldanLT likes this.
  13. AzzidReign

    AzzidReign Well-Known Member

    Sorry, my time has been limited lately. But Brogan has outlined a lot of the conditional statements in which you can use with DFP. I think this code is what you are looking for:
    How can I show content in all forums with a specific parent?
    <xen:if is="{$forum.parent_node_id} == x">
    This content will show in forums of parent x

    Of course you are going to have to modify the google code similar to the nodeID one that I've done. If you can't figure it out, I'll get back to this later and add it to the guide.
  14. kontrabass

    kontrabass Well-Known Member

    I got it - thanks! :)
  15. akia

    akia Well-Known Member

    Slightly related to this. Have you been able to figure out how to use the passback tags.
  16. AzzidReign

    AzzidReign Well-Known Member

    I haven't tried it but it should be rather easy. Create ad units like so:
    Tier 1 [location 1]
    Tier 1 [location 2...etc]
    Tier 2 [location 1]
    Tier 2 [location 2...etc]
    Tier etc....

    Then what you will do is take your tier 2 ad unit code and put it in main network used for Tier 1. If that network can't fill, it will go to your passback/back up tag which will be tier 2 ad units. You can do the same with Tier 2 and 3 and etc...

    Let me know if this helps.
  17. CMGDevel

    CMGDevel Active Member

    Cool idea, but what if my DFP feeds multiple forums on multiple domains? How would the forumid work then? It may not be unique.

    Is there a Xenforo variable that would identify the thread topic? Is so, one could even match the ads to a specific topic.
  18. AzzidReign

    AzzidReign Well-Known Member

    For your first question, it would work the same unless you are targeting node=x on forum a and node=y on forum b...then you are screwed. What you would have to do is set up 2 different campaigns (should be doing that anyways if you are sending across multiple sites), and then this technique would work just fine.

    For your second question, I'm not sure if there is a way...I'd have to look into it a bit but I'm sure someone here may already know. I would look through Brogan's conditional thread to see if there is a way to target a thread/topic.
  19. jeffwidman

    jeffwidman Active Member

    Any idea how to expose the ids of the user groups the user belongs to? It's a lot more flexible than just targeting guests/registered users.
  20. AzzidReign

    AzzidReign Well-Known Member

    Hey Jeff! I'm not quite sure, and again, I'm not a coder but I do a lot of trial and error to get stuff to work. So if I were to need it, I would take something like this from the conditional statement tutorial:
    {xen:helper ismemberof, $visitor, x}

    Hack it to pieces to see what happens so my code might look something like:
    googletag.pubads().setTargeting("usergroupid", "{xen:helper ismemberof, $visitor}");

    This would follow the general idea of the forumid part of the guide. Assuming that {xen:helper ismemberof, $visitor} pumps out a number, then you could do the custom criteria and properly target 1 usergroup or multiple in a single custom criteria (again, similar to forumid).

    Please let me know if this works so I can add it for others as I'm sure there are many people that would like this.

    One question though, what is your goal in this?

Share This Page