This forum is now closed to new posts
All existing content remains available to browse and search. For support, please email us at contact@tagdiv.com Our team is happy to help as soon as possible.
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!
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
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
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 đ
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!
| Cookie | Duration | Description |
|---|---|---|
| cookielawinfo-checkbox-advertisement | 1 year | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Advertisement". |
| cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
| cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
| cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
| cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
| cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
| viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
| viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
| Cookie | Duration | Description |
|---|---|---|
| _ga | 2 years | This cookie is installed by Google Analytics. The cookie is used to calculate visitor, session, campaign data and keep track of site usage for the site's analytics report. The cookies store information anonymously and assign a randomly generated number to identify unique visitors. |
| _gat_gtag_UA_43963494_1 | 1 minute | This cookie is set by Google and is used to distinguish users. |
| _gid | 1 day | This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the website is doing. The data collected including the number visitors, the source where they have come from, and the pages visted in an anonymous form. |
| Cookie | Duration | Description |
|---|---|---|
| IDE | 1 year 24 days | Used by Google DoubleClick and stores information about how the user uses the website and any other advertisement before visiting the website. This is used to present users with ads that are relevant to them according to the user profile. |
| test_cookie | 15 minutes | This cookie is set by doubleclick.net. The purpose of the cookie is to determine if the user's browser supports cookies. |
| VISITOR_INFO1_LIVE | 5 months 27 days | This cookie is set by Youtube. Used to track the information of the embedded YouTube videos on a website. |
| YSC | session | This cookies is set by Youtube and is used to track the views of embedded videos. |
| Cookie | Duration | Description |
|---|---|---|
| CONSENT | 16 years 5 months 26 days 13 hours 25 minutes | No description |
| yt-remote-connected-devices | never | This cookies is set by Youtube and stores the user's video player preferences using embedded YouTube video. |
| yt-remote-device-id | never | This cookies is set by Youtube and stores the user's video player preferences using embedded YouTube video. |