Login  Register

Re: Media Queries

Posted by Harvey on Nov 14, 2016; 12:15pm
URL: https://support.nabble.com/Media-Queries-tp7597404p7597518.html

Greg,

Every ad in your google adsense account has a specific number.  The commented out /*Leaderboard*/ is for the humans to know what ad they are looking when dealing with the code.  The ad_slot actually tells google which ad to place in the spot.  I am trying to figure out some kind of if/then statement that that pulls the 728 x 90 unless the screen width is less than say 1000px. In that case it would pull a different ad_slot that is a 320 x 100.

Does this help?

On Mon, Nov 14, 2016 at 5:52 AM, GregChapman [via Nabble Support] <[hidden email]> wrote:
Mmm! I don't think I understand the full situation here.

Are you talking about a different forum or a different place in the forum where the adverts are to appear? I say this because your earlier post included a similar script with the lines:
 /* Leaderboard */
                    google_ad_slot = "<a href="tel:9529659947" value="+19529659947" target="_blank">9529659947";
                    google_ad_width = 728;
                    google_ad_height = 90;
                    google_page_url = "<n.current_url/>";
In both cases there's an initial comment line, then what I assume is a line that is Google's reference to the adverts to be inserted or your account with them, then the size for the advert is specified and finally a NAML reference which will produce the forum's address. All of these data items, I'm sure, will be used by the JavaScript code (a .js file) in the following script, which you see is hosted on Google's servers.

The point is that the earlier script will insert large ads and the new one will insert small ads, but neither by itself will change the advert size depending on size of the screen/window of the device showing the page. Whereas the Google code you posted will - and I understood that that is what you want to achieve.

So before I give a step-by-step guide on how to edit the the macro that is my best guess on what will work to dynamically change the size of the advert depending on the device/window size used by your site's visitor, I would need to know what the number represents in the line:
google_ad_slot = "<a href="tel:9529659947" value="+19529659947" target="_blank">9529659947";
or maybe just leave you to guess what the appropriate number is, given there are several in your examples.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!



If you reply to this email, your message will be added to the discussion below:
http://support.nabble.com/Media-Queries-tp7597404p7597517.html
To unsubscribe from Media Queries, click here.
NAML



--
HTTPS Please!