XF 2.0 Advertising

limboclub

Active member
We've run an upgrade on a clone of the site to test. Lots of issues but we suspected as much.

One thing that worries me is the "ad_" templates are now gone, and the Advertising system has not absorbed them. There are no advertisements in the list.

Is there a list of xf:ad hooks in version 2?

Is there a way to avoid losing all ad_ templates? Automatically moving them to the Advertising system?

Or are we left with the job of recreating dozens of advertising locations from scratch?
 
Oh God. It really isn't.

And why wipe out all of the ad templates? Some of this stuff is really just developer driven without thought to real users.

Looks like a day of hacking around with something that could have been automated.
It can't really be automated. The template syntax is very different, so it's very possible that the existing ad code you were using (particular if you were doing things to control how ads were displayed) wouldn't work at all -- or might work but be broken in unexpected and non-obvious ways.

The upgrade from 1.x to 2.x is very significant and does require planning, particularly if you have customizations (most notably to the style), as they will need to be redone as the whole front-end framework is hugely changed.
 
It can't really be automated. The template syntax is very different, so it's very possible that the existing ad code you were using (particular if you were doing things to control how ads were displayed) wouldn't work at all -- or might work but be broken in unexpected and non-obvious ways.

The upgrade from 1.x to 2.x is very significant and does require planning, particularly if you have customizations (most notably to the style), as they will need to be redone as the whole front-end framework is hugely changed.
Are there some template conversion guides we're missing? I have this one - https://xenforo.com/community/resources/conditional-statements-for-xenforo-2.5795/ - but it seems to have errors. Is there anything official?

As for the current thread:
Right now Advertising system changes aren't showing up on the site.

I edit the advertisement, the change saves and displays in the edit box, but the change does not display on the site.

Any ideas?
 
I'm assuming all of this is stored in the _ads template, but that template isn't changing with the edits in the Advert system. I even delete advertisements and they still display on the live site.

And yet, in the Advertisements system my changes display. Is it being cached somewhere? Is there a rebuild I need to do?
 
Last edited:
The XF2.x system assumes you are running stand alone ad tags, ie: AdSense. For those of us running more complex systems (GAM or prebid) there is no option in the XF2 Advertisements setup to place code in the header or footer. I ended up creating 4-5 ad_xxxxxxx templates and manually placing them either in the head or just prior to the closing html.

Are you testing on the most current version? I know I discovered an error when I copy/pasted my XF1 codes into the XF2 Advertisements positions, the code didn't auto-check for errors (or in my case, old code). I manually cleared the _ads template and started fresh, but I believe you can also disable ALL of your Advertisement placements to clear the errors...triple check your if/then setups to ensure you are using XF2 syntax. That error is corrected in the current 2.1 beta release. (ie: it should refuse to save the advertisement position and generate an error)

There are a couple things that didn't seem to carry over from XF1...one I recall offhand is "visitors_from_search"....which I used to help target those users who arrived from search engines.
 
Current version.

Fixed the _ads outdated template issue by reverting the _ads template. My edits to "fix" the issue just made it seem like a style-level edited template.

I'm using DFP with header bidding and a couple of other systems like floating mobile footer ads. I have a header template for DFP responsive ad sizing.

No ads are displaying so I assume it is doing something screwy with the order in which it renders the templates.

groan

I still have some hair left to pull out, but that is a rapidly depleting resource and I will have to progress to chewing my nails off.

I may just abandon this Xf ads system and copy over my old templates. No idea why they were deleted by the upgrade.
 
Last edited:
Sounds similar to my old system, it was a headache to get things working. Switched to prebid late in 2017, which is simply a different headache :)

Are you testing on a local environment? GAM (what was DFP) should only serve ads on approved domains. In my setup, I'm running a "live" test site on a subdomain, so the ads render. If you are running on a localhost or outside the registered GAM domain, then ads should not appear.

Test each placement with simple text above the GAM code, then view source and triple check those locations.
 
Just for reference editing the _ads or _page templates makes it so you can do style specific edits easily. However.... if you make a change in the ad system or page content that template will be outdated as it doesn't automatically inherit the changes when you edit those templates on a style level.

The fix here would be to simply revert the _ads template so it can start inheriting the Advertisement system changes again.
 
It's in a clone on a sub-domain. It should work. Good to hear that you got yours sorted - gives me hope. Header bidding seems to give income a boost but yeah it has its own issues. Bad/scam ads seem to be a regular thing.

With my ads failing, there will be some tiny syntax thing or whatever. It's just a headache to track it all down and work out how this new system works. I can't find any useful doco for it. Let me know if you know of any official stuff.

Yeah all of my old ad_ templates have a comment in them with their name so I can find them in the code.

This will just be hours and hours of manual re-working and testing for the myriad little changes. :mad:

I mean... why change <xen:... > to <xf:... > ?? Easy enough to copy out the template text and run a find and replace but it's one more tiny thing that rips up time and pushes back our planned update time.

</xen:rant>

[ERROR!]

Oh ffs...

</xf:rant>
 
Just for reference editing the _ads or _page templates makes it so you can do style specific edits easily. However.... if you make a change in the ad system or page content that template will be outdated as it doesn't automatically inherit the changes when you edit those templates on a style level.

The fix here would be to simply revert the _ads template so it can start inheriting the Advertisement system changes again.
Yep, figured that one out thanks.

I'll keep posting the stumbling blocks and gotchas in here as I find them, hopefully grinding through it publicly helps other people too.
 
It's in a clone on a sub-domain. It should work. Good to hear that you got yours sorted - gives me hope. Header bidding seems to give income a boost but yeah it has its own issues. Bad/scam ads seem to be a regular thing.

Malvertising isn't unique to header bidding by any means. It does make it more challenging to track. I use a 3rd party to prescan....just under 600,000 impressions were scanned today, just under 5000 were blocked. US holiday targeting, the blocked number is usually closer to 1500.
 
Malvertising isn't unique to header bidding by any means. It does make it more challenging to track. I use a 3rd party to prescan....just under 600,000 impressions were scanned today, just under 5000 were blocked. US holiday targeting, the blocked number is usually closer to 1500.
Ooo - convo me the third party service name could you?
 
Top Bottom