I added Adword Conversation Tracking to my webshop.
I have Magento shop and inside of body tag I have following code:
<!-- Google Code for Conversion_Adwords_DrSchaette Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 123456789;
var google_conversion_language = "de";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "RstGBPX52wEEk8Dz4wS";
var google_conversion_currency = "EUR";
var google_conversion_value = 1.00;
var google_remarketing_only = false;
var google_conversion_order_id = "100031728";
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt=""
src="//www.googleadservices.com/pagead/conversion/123456789/?value=1.00¤cy_code=EUR&label=RstGBPX52wEEk8Dz4wS&guid=ON&oid=100031728&script=0"/>
</div>
</noscript>
Google tag assistant report me following errors:
Code should be placed directly above the closing tag.
Conversion Value should be prefixed with standard currency.
Non-standard implementation
First error I know what it is, but second and third I don't know how to fix.
If the conversions are appearing properly in your AdWords account, then you can safely ignore these warnings. Google Tag Assistant can be a bit buggy sometimes.
Related
When I inject this example GTM tag on a site the '==' in the src string is encoded as \x3d\x3d which fails to resolve. Is there a way to stop the encoding?
GTM tag:
<script type="text/javascript"> !function(o,t){var src="https://test#testsite.com/test/1MmE5ZDA4ZGExODZkOTQifQ==/assets/demo.js";
...
</script>
on page:
<script type="text/javascript"> !function(o,t){var src="https://test#testsite.com/test/1MmE5ZDA4ZGExODZkOTQifQ\x3d\x3d/assets/demo.js";
...
</script>
I had a similar issue trying to insert an src into an iframe. I was populating the query string with GTM variables that contained "=" but they would get encoded as %3D.
My solution was injecting the HTML tag on the page using Javascript instead.
OLD WAY (HTML)
<iframe height="1" width="1" frameborder="0" scrolling="no" src="https://www.something.com/?containerTagId={{containerID}}"></iframe>
NEW WAY (JAVASCRIPT)
<script>
var script = document.createElement('iframe');
script.height="1";
script.width="1";
script.frameborder="0";
script.scrolling="no";
script.name="conversion";
script.src = 'https://www.something.com/?containerTagId={{containerID}}';
document.body.appendChild(script);
</script>
I'm trying to insert a conversion tracking script into a thank you page that one is directed to upon completing a contact form. I'm working in Wordpress and using the WPWOX Custom Script Integration plugin to insert my script, which is as follows:
<!-- Google Code for contact-us/thank-you Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 978060811;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "OmTcCKWT6mQQi4yw0gM";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/978060811/?label=OmTcCKWT6mQQi4yw0gM&guid=ON&script=0"/>
</div>
</noscript>
However, when running Tag Assist I am given the error of "No HTTP response detected".
Any idea why I I'm getting the error? Here is the link to the thank you page http://expoprop.co.za/thank-you/
I'm looking for some info on how to best manage multiple Google AdWords and other tags. My primary question is how to handle both the regular AdWord tag, the standard AdWords Remarketing tags and one of the custom AdWords Remarketing tags I created - say a 180 day RLSA list tag. Do I need a separate tag call (vars, call to the conversion script and the noscript img tag)? Is there a way to combine?
Also - being an ecommerce site - I see that for AdWords I need to add my sales total to the noscript img tag. But what about to the remarketing one? It has a default value of 1.00, instructions make no mention to change that and the js version doesn't have any fields for it so I assume 1.00 is correct?
I am adding my entire code for the receipt of my store which has GA, standard AdWord and as well as the 180 day RLSA tag (which I assume is valid as the basic Remarketing tag). Docs don't seem to ever address multiple tags unfortunately.
<!-- BEGIN: AdWords -->
<script type="text/javascript">
var google_conversion_id = 1002886276;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "DZAUCPS-jQoQhKmb3gM";
var google_conversion_value = 64.98;
var google_conversion_currency = "USD";
var google_remarketing_only = false;
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/1002886276/?value=64.98¤cy_code=USD&label=DZAUCPS-jQoQhKmb3gM&guid=ON&script=0" />
</div>
</noscript>
<!-- END: AdWords -->
<!-- BEGIN: Analytics -->
<script type="text/javascript">
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-40148609-3', {
userId: '750fd151-6852-4a35-974d-c99f85f993f3'
});
ga('send', 'pageview', {
'title': 'Receipt'
});
ga('send', 'event', 'Completed Order', {
category: 'Shopping',
revenue: 64.98,
id: 734352106,
total: 64.98,
shipping: 0,
tax: 0,
products: []
});
ga('set', 'ecomm_pagetype': 'purchase');
ga('set', 'ecomm_totalvalue', 64.98);
ga('set', 'ecomm_prodid': [218825388699, 118825388699])
</script>
<!-- END: Analytics -->
<!-- BEGIN: AdWords Remarketing -->
<script type="text/javascript">
var google_conversion_id = 1002886276;
var google_conversion_label = "9NX_CKTrkgoQhKmb3gM";
var google_custom_params = {
ecomm_pagetype: 'purchase',
ecomm_totalvalue: 64.98,
ecomm_prodid: [218825388699, 118825388699]
};
var google_remarketing_only = true;
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1002886276/?value=1.00¤cy_code=USD&label=9NX_CKTrkgoQhKmb3gM&guid=ON&script=0" />
</div>
</noscript>
<!-- END: AdWords Remarketing-->
Thanks for any assistance or official guides to multiple tag management.
The question is old, yet I came here from Google just before I found an answer to a similar problem, so I'll try to share my conclusions. It is best to integrate Google Tag Manager in case of having multiple codes. I consider it to be the best practice for your example.
One ad unit just stopped to work and after trying to generate new code it is still not working. When I use google console it is just showing warning Ad unit failed to fetch. Other 3 ads are working normally. They are inserted before I started to work on this project.
New ad code is generated like
header
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/6000854/R300x250_L', [300, 250], 'div-gpt-ad-1367703773182-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
body
<!-- R300x250_L -->
<div id='div-gpt-ad-1367703773182-0' style='width:300px; height:250px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1367703773182-0'); });
</script>
</div>
Old code is generated like
header
<script type='text/javascript' src='http://partner.googleadservices.com/gampad/google_service.js'></script>
<script type='text/javascript'>
GS_googleAddAdSenseService("ca-pub-2838961657718357");
GS_googleEnableAllServices();
</script>
<script type='text/javascript'>
GA_googleAddSlot("ca-pub-2838961657718357", "Top728x90");
GA_googleAddSlot("ca-pub-2838961657718357", "Right300x250");
GA_googleAddSlot("ca-pub-2838961657718357", "Right300x250Bottom");
</script>
<script type='text/javascript'>
GA_googleFetchAds();
</script>
body
<!-- Right300x250Bottom -->
<script type='text/javascript'>
GA_googleFillSlot("Right300x250Bottom");
</script>
Is there maybe conflict because of diferent tags or code
NOTE: I am just wordpress front end developer, I don't have access to google DFP services and I am not generating tags or code
EDIT: Based on this discussion it looks like using the old GAM tags with GPT tags may now be an issue (just recently) http://productforums.google.com/forum/#!topic/dfp/snK7znwUMBE
I think you should convert the GAM tags to to GPT tags and use just the DFP GPT tags if possible to stop this happening... its most probably a conflict between the two scripts and depending on the order they get loaded the GPT tags may not work...
ORIGINAL:
I just tried your code and two ads showed as expected. So there does not appear to be any conflicts using both scripts at the same time.
Potentially you have been refreshing the page so many times that there are no ads that will be displaying for you through DFP anymore because of rate limits? That is just a wild guess though. If I refresh the page a lot I do get the failed to fetch message every now and then in the console so I think it is probably just a rate limit and something that a normal user will not have a problem with.
This is the code that I am using, two 300x250 ads show on the page so everything is working correctly.
<html>
<head>
<title>DFP TEST</title>
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/6000854/R300x250_L', [300, 250], 'div-gpt-ad-1367703773182-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
<script type='text/javascript' src='http://partner.googleadservices.com/gampad/google_service.js'></script>
<script type='text/javascript'>
GS_googleAddAdSenseService("ca-pub-2838961657718357");
GS_googleEnableAllServices();
</script>
<script type='text/javascript'>
GA_googleAddSlot("ca-pub-2838961657718357", "Top728x90");
GA_googleAddSlot("ca-pub-2838961657718357", "Right300x250");
GA_googleAddSlot("ca-pub-2838961657718357", "Right300x250Bottom");
</script>
<script type='text/javascript'>
GA_googleFetchAds();
</script>
</head>
<body>
<!-- R300x250_L -->
<div id='div-gpt-ad-1367703773182-0' style='width:300px; height:250px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1367703773182-0'); });
</script>
</div>
<!-- Right300x250Bottom -->
<script type='text/javascript'>
GA_googleFillSlot("Right300x250Bottom");
</script>
</body>
</html>
Tried several methods but still unable to get Google Ad to render. The intention is to responsively place ads based on window width. But I'm unable to place even a single ad.
Here's the most reliable method I can think of:
/* templates.html */
<head>
<script type="text/javascript">
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
</script>
<script type="text/javascript" src="http://www.googletagservices.com/tag/js/gpt.js"> </script>
</head>
<body>
<div class="container">
{{> page}}
</div>
</body>
<template name="page">
<div class="page_ad"></div>
</template>
/* client.js */
Template.page.rendered = function(){
googletag.cmd.push(function() {
googletag.defineSlot('LEADERBOARD', [728, 90], 'AD-CODE-ID').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
$('.page_ad').html("<div id='AD-CODE-ID' style='width:728px; height:90px;'>");
googletag.cmd.push(function() { googletag.display('AD-CODE-ID')});
};
Thanks for your consideration.
Here is how I do it. You can read more about it in this blog post.
Template.MyAds.rendered = function() {
$.getScript("//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js", function() {
var ads, adsbygoogle;
ads = '<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-72414***074839" data-ad-slot="4009***57" data-ad-format="auto"></ins>';
$('.leaderboard').html(ads);
return (adsbygoogle = window.adsbygoogle || []).push({});
});
};
Check out the iframe solution here; Meteor JS: use external script
Check out the information about that method being against TOS; http://productforums.google.com/forum/#!category-topic/adsense/adsense-basics-and-policies/JP6vrWxFMVg