Last active
December 10, 2015 07:38
-
-
Save krogsgard/4402068 to your computer and use it in GitHub Desktop.
Responsive Ad Slots for Google Ads. Load different ad slots depending on the window size. Doesn't currently work on resize.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var window_innerwidth = window.innerWidth; | |
if ( window_innerwidth < 630 ) { | |
GA_googleFillSlot( "Skinny-Ad" ); | |
} else if ( window_innerwidth >= 630 && window_innerwidth < 728 ) { | |
GA_googleFillSlot( "In-Line-Ad" ); | |
} else if ( window_innerwidth >= 728 && window_innerwidth < 950 ) { | |
GA_googleFillSlot( "Skinny-Ad" ); | |
} else { | |
GA_googleFillSlot( "In-Line-Ad" ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment