Last active
August 29, 2015 14:07
-
-
Save Tmeister/23acc536580f43335d4d to your computer and use it in GitHub Desktop.
This file contains 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
$(function(){ | |
var fileRef = document.createElement('script'); | |
fileRef.setAttribute("type","text/javascript"); | |
fileRef.setAttribute("src", "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"); | |
document.body.appendChild(fileRef); | |
/*Change the SELECTOR-HERE for the one you want to add */ | |
$("SELECTOR-HERE").append('<br/><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4429314952077491" data-ad-slot="8849066704" data-ad-format="auto"></ins>'); | |
$("SELECTOR-HERE").append('<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @Tmeister,
Is this working just fine for you?
Im trying to implement GA + Optimizely but I always get the:
"Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened."
Did you solve this issue?