Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
temporary_saint
tagDiv Member

Perfect! I didn’t realize I had to pick a post type as well! Thx for sharing that documentation link, for some reason I couldn’t find it last night!

temporary_saint
tagDiv Member

I kept trying and did eventually get it going… I’m getting a bit of weirdness in the middle sizes though… I’d like to go with 728×90 >> 320×50 (without the 468×60) — I’ll have to play around with it a bit more I guess.

Right now I’m getting some the odd refresh with no ad served at all.

I wonder if it’s because I’ve added the main javascript into the ANALYTICS section (so it goes into the <head> instead of into the CUSTOM JAVASCRIPT section which puts the code in the footer)… maybe I should just add the script right into header.php

temporary_saint
tagDiv Member

Hi @Pedropapito

I’ve tried getting this going multiple times and I’m still having issues setting it up… Can you confirm that this still works for you?

Cheers. Dale

temporary_saint
tagDiv Member

Thank you for sharing @Pedropapito!

This allows for different ad sizes on different devices – which may be what I’m looking for if I think it through.

Ultimately I’m looking to display an ad in 2 different places – depending on device – so that a 300×250 on the sidebar has better visibility when reformatted for a mobile phone. Here is what I’m thinking (but there may be an easier way than this).

Two ad units, lets call them 300x250_desktop and 300x25_mobile.

300x250_desktop gets placed in the sidebar – it is visible when viewed on tablet / desktop but NOT on mobile.

300x250_mobile is placed Article Inline – it is NOT visible on tablet / desktop but it is visible on mobile.

So effectively only one 300×250 ad unit displays at a time depending on whether it is viewed on desktop or mobile phone.

Can your code example handle this scenario with 2 versions of the same ad size (once again, they can be set up as different ad units)?

Ultimately I’m looking for something like:

If display is mobile, show here (article_inline) else show here (sidebar) … this would be super-simple cause I wouldn’t have to have two ad units – just one that gets executed in different spots depending on the device.

Apologies – I’m probably confusing this too much.

I just wish the theme ad toggle buttons worked for DFP as they do for AdSense because I know exactly how to achieve what I’m going for 😉

temporary_saint
tagDiv Member

Thanks Lucian.

I will give this a try – looks like this will be effective in hiding the ad but will using display: none; still allow the dfp ad to count an impression?

ie. does this trick effectively stop DFP from firing an impression OR does it simply hide the ad?

Thanks for your help!

Viewing 5 posts - 26 through 30 (of 30 total)