Last active
December 15, 2015 20:49
-
-
Save mauriciodarocha/5321317 to your computer and use it in GitHub Desktop.
Google Conversion Tag Image. Insere imagem para google ad services.
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
<script type="text/javascript"> | |
$(document).ready(function (param) { | |
place_google_conversion_img_tag(); | |
}); | |
var place_google_conversion_img_tag = function () { | |
// não passa deste ponto se não for a página "finaliza-compra" | |
if(!$('body').hasClass("finaliza-compra")) return false; | |
// não passa deste ponto se já foi inserida a tag. | |
if($(".gctag").length>0) return false; | |
var orderid = $('#orderid').text(); | |
var totalAmount = $('#totalAmount').text().replace(".","").replace(",","."); | |
var img_url = "//www.googleadservices.com/pagead/conversion/986378069/?value="+totalAmount+"&label=NiowCPPttgQQ1d6r1gM&guid=ON&script=0"; | |
var img = '<img class="gctag" height="1" width="1" style="border-style:none;" alt="" src="'+img_url+'"/>'; | |
$("body").append(img); | |
return true; | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment