Jump to content

Google adwords conversion tracking code placement


williambesson

Recommended Posts

Hello,

 

I have seen this question on another thread but it was 2 years old and the solution didn't work for me unfortunately.

 

So here's my question: Where should I put the google adwords tracking code so that I can see conversions in my google adwords account.

 

I have tried an add-on module but this one didn't work and the support was non existent.

 

Many thanks for your help on this.

 

Guillaume Besson

 

PS: I have PS version 1.4.2

Link to comment
Share on other sites

you should use it on order-confirmation page, which mean that you have to insert this code in:

 

themes/YOUR_THEME/order-confirmation.tpl

 

can you please paste the script you've got? i'm asking because you have to use {literal}{/literal} tags probably

Link to comment
Share on other sites

Many thanks for such a fast reply:

 

I might know where the problem is.

 

I have themes/prestashop/order-confirmation.tpl where I did put the code.

and there is themes/mytheme/order-confirmation.tpl where I didn't put the code.

 

Do you think this is the problem?

 

Thanks

Link to comment
Share on other sites

Here are my findings. I have been to the confirmation page and retrieved the source code.

http://www.presencepro.fr/wp-content/uploads/2013/06/order-finalised-screen.jpg

 

No trace of the google adwords conversion code there! :(

 

This where I placed it though:

http://www.presencepro.fr/wp-content/uploads/2013/06/order-confirmation-tpl.jpg

 

Does it make sense to you?

Link to comment
Share on other sites

maybe it is related to the smarty cache? Try to turn on force compilation (under the preferences > performance tab in BO)

try again (order something and check page source)

 

you can also clear smarty cache, just empty folders:

cache/smarty/cache

cache/smarty/compile

Link to comment
Share on other sites

  • 5 months later...

Did you ever get this to work? I've tried adding my adwords conversion script in to the order-confirmation.tpl file with and without the literal tags and nothing. Cleared the smarty cache etc, love PS but can't believe how difficult it is to add simple script tags from UA or Adwords from a fairly big player when it come to website acquisitions!

 

if you did manage to get it to work i'd be grateful!

Edited by markcox (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 3 weeks later...

You have to place it on order-confirmation.tpl and putting the script variables between {literal}{/literal} for ex.

<script type="text/javascript">
   /* <![CDATA[ */
{literal}
   var google_conversion_id = 123456789;
   var google_conversion_language = "en";
   var google_conversion_format = "2";  
   var google_conversion_color = "ffffff";  
   var google_conversion_label = "AAAAAAAAAAAAAAAAAAA";  
   var google_conversion_value = 0;
{/literal}
   /* ]]> */
   </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/
  ?label=AAAAAAAAAAAAAAAAAAA&guid=ON&script=0"/>
   </div>
   </noscript>

That, of course, is for a macro conversion (a purchase on your site). then you also have micro conversions, for example a registration or generating a new cart, a call (lead) which you can also track as goal on Analytics or micro-conversion on Adwords

  • Like 2
Link to comment
Share on other sites

Hi Jorgiob,

 

Thanks for the info!

I have now implemented on my site, thank you! I'm going to verify if its working later......

 

I guess, for the micro-conversions analytics goal I would just need to put the code into relevant .tpl files or is there any thing else which needs modification for the code to work?

 

Kind regards,

Link to comment
Share on other sites

Hi Jordiob,

 

Thanks for the info!

 

Currently I'm having another related problem, please check my post link below, due to this problem I'm currently unable to test the above solution as well. Just wondering if you could help in this regard as well or refer me to somewhere for the solution?

 

I have tried by removing the Google codes from the order-confirmation.tpl file or restoring the original file unfortunately, nothing has worked so far!

 

http://www.prestashop.com/forums/topic/311605-paypal-order-confirmation-page/?do=findComment&comment=1578040

 

Thanks a lot!

 

Best regards,

Link to comment
Share on other sites

  • 5 months later...

hi!

 

can u help me? my order-confirmation.tpl inside the template looks like this:

 

 
{capture name=path}{l s='Order confirmation'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}
 
<h1>{l s='Order confirmation'}</h1>
 
{assign var='current_step' value='payment'}
{include file="$tpl_dir./order-steps.tpl"}
 
{include file="$tpl_dir./errors.tpl"}
 
{$HOOK_ORDER_CONFIRMATION}
{$HOOK_PAYMENT_RETURN}
 
<br />
{if $is_guest}
<p>{l s='Your order ID is:'} <span class="bold">{$id_order_formatted}</span> . {l s='Your order ID has been sent via email.'}</p>
<a href="{$link->getPageLink('guest-tracking', true, NULL, "id_order={$reference_order}&email={$email}")|escape:'html'}" title="{l s='Follow my order'}"><img src="{$img_dir}icon/order.gif" alt="{l s='Follow my order'}" class="icon" /></a>
<a href="{$link->getPageLink('guest-tracking', true, NULL, "id_order={$reference_order}&email={$email}")|escape:'html'}" title="{l s='Follow my order'}">{l s='Follow my order'}</a>
{else}
<a href="{$link->getPageLink('history', true)|escape:'html'}" title="{l s='Back to orders'}"><img src="{$img_dir}icon/order.gif" alt="{l s='Back to orders'}" class="icon" /></a>
<a href="{$link->getPageLink('history', true)|escape:'html'}" title="{l s='Back to orders'}">{l s='Back to orders'}</a>
{/if}
 
 
where should i put the conversion code?
Link to comment
Share on other sites

 

hi!

 

can u help me? my order-confirmation.tpl inside the template looks like this:

 

 
{capture name=path}{l s='Order confirmation'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}
 
<h1>{l s='Order confirmation'}</h1>
 
{assign var='current_step' value='payment'}
{include file="$tpl_dir./order-steps.tpl"}
 
{include file="$tpl_dir./errors.tpl"}
 
{$HOOK_ORDER_CONFIRMATION}
{$HOOK_PAYMENT_RETURN}
 
<br />
{if $is_guest}
<p>{l s='Your order ID is:'} <span class="bold">{$id_order_formatted}</span> . {l s='Your order ID has been sent via email.'}</p>
<a href="{$link->getPageLink('guest-tracking', true, NULL, "id_order={$reference_order}&email={$email}")|escape:'html'}" title="{l s='Follow my order'}"><img src="{$img_dir}icon/order.gif" alt="{l s='Follow my order'}" class="icon" /></a>
<a href="{$link->getPageLink('guest-tracking', true, NULL, "id_order={$reference_order}&email={$email}")|escape:'html'}" title="{l s='Follow my order'}">{l s='Follow my order'}</a>
{else}
<a href="{$link->getPageLink('history', true)|escape:'html'}" title="{l s='Back to orders'}"><img src="{$img_dir}icon/order.gif" alt="{l s='Back to orders'}" class="icon" /></a>
<a href="{$link->getPageLink('history', true)|escape:'html'}" title="{l s='Back to orders'}">{l s='Back to orders'}</a>
{/if}
 
 
where should i put the conversion code?

 

 

Place it at the very bottom after the {/if}

Link to comment
Share on other sites

  • 8 months later...

You have to place it on order-confirmation.tpl and putting the script variables between {literal}{/literal} for ex.

<script type="text/javascript">
   /* <![CDATA[ */
{literal}
   var google_conversion_id = 123456789;
   var google_conversion_language = "en";
   var google_conversion_format = "2";  
   var google_conversion_color = "ffffff";  
   var google_conversion_label = "AAAAAAAAAAAAAAAAAAA";  
   var google_conversion_value = 0;
{/literal}
   /* ]]> */
   </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/
  ?label=AAAAAAAAAAAAAAAAAAA&guid=ON&script=0"/>
   </div>
   </noscript>

That, of course, is for a macro conversion (a purchase on your site). then you also have micro conversions, for example a registration or generating a new cart, a call (lead) which you can also track as goal on Analytics or micro-conversion on Adwords

 

 

Why did you set up google_conversion_value to 0 ?

Google's suggested php implementation looks like this:

<!-- Kod Google na stronę konwersji zakupowej -->
	<script type="text/javascript">
	/* <![CDATA[ */
	var google_conversion_id = 1234567890;
	var google_conversion_language = "pl_PL";
	var google_conversion_format = "1";
	var google_conversion_color = "666666";
	var google_conversion_label = "xxx-XXx1xXXX123X1xX";
	var google_conversion_value = 10;                                 //strike through!
	if (<? echo $totalValue ?>) {                                     //bold!
		var google_conversion_value = <? echo $totalValue ?>      //bold!
		var google_conversion_currency = <? echo $currency ?>     //bold!
	}                                                                 //bold!
	var google_conversion_currency = "PLN";                           //strike through!
	/* ]]> */ 
	</script>
	<script type="text/javascript"
	src="//www.googleadservices.com/pagead/conversion.js">
	</script>
	<noscript>
	<img height=1 width=1 border=0
	src="//www.googleadservices.com/pagead/
	conversion/1234567890/?value=
	<? echo $totalValue ?>&conversion_currency=<? echo $currency ?>
	&label=Zakup&script=0">
	</noscript>
	</body>

but everyone should base on code given to them by google adwords, and then cut out lines which are struck through, and implement proper variables in places which are bold.

EDIT: Sorry, I realised that strike-through and bold formatting doesn't work inside code field. It is hard to repair this, so i commented lines :<<

 

On prestashop 1.6 modifications should look like this (for example; works for me):

 

1. In controllers/front/OrderConfirmationController find:

public function initContent()
	{
		parent::initContent();

		$this->context->smarty->assign(array(
			'is_guest' => $this->context->customer->is_guest,
			'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(),
			'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()
		));

and change to:

public function initContent()
	{
		parent::initContent();

        $order = new Order($this->id_order);
        $currency = new Currency($order->id_currency);

		$this->context->smarty->assign(array(
			'is_guest' => $this->context->customer->is_guest,
			'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(),
			'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn(),
                        'name_of_cart_value_variable' => $order->getOrdersTotalPaid(),   // name_of_cart_value_variable
                        'name_of_currency_variable' => $currency->sign                   // name_of_currency_variable
		));

2. Then navigate to themes/YOUR_THEME/order-confirmation.tpl, and after the last {/if} add:

<script type="text/javascript">
    /* <![CDATA[ */
    {literal}
    var google_conversion_id = 1234567890;     //your conversion id given by google!
    var google_conversion_language = "pl_PL";  //for example. You could put your language sign, or create another variable responsible for this.
    var google_conversion_format = "1";        //for example
    var google_conversion_color = "666666";    //example as well
    var google_conversion_label = "xxx-XXx1xXXX123X1xX"; //your label given by google!
    if ( {/literal}{$name_of_cart_value_variable}{literal} ) {
        var google_conversion_value =  "{/literal}{$name_of_cart_value_variable}{literal}"
        var google_conversion_currency =  "{/literal}{$name_of_currency_variable}{literal}"
    }                                          //careful in above lines 
    var google_remarketing_only = false;       //for example
    {/literal}
    /* ]]> */
</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/1234567890/?value={$name_of_cart_value_variable}&conversion_currency={$name_of_currency_variable}&label=Purchase&script=0"/>         //the last two variables here
    </div>
</noscript>

You could customize other values send to google adwords, then you should retrieve them in controller. You got the vibe.

 

EDIT: Sorry for poor formatting, it's hard to get rid of code blocks once they had been added.

Edited by khejit68 (see edit history)
  • Like 2
Link to comment
Share on other sites

Hi khejit68,

 

An alternative method to using the GA (Google Analytics) code directly is to use GTM (Google Tag Manager), which handles your GA tracking and conversions, and also makes life much easier when adding more services to your shop. Here are some notes on how to implement this in Prestashop 1.6.

 

My implementation will get even more data into GA than your code (things like shipping costs, products, price per product, etc.)... with fewer changes in your templates (most themes only need a snippet in header.tpl).

 

Thanks,

Ed

  • Like 1
Link to comment
Share on other sites

Hi,

 

Did you get this sorted in the end, if not below is how I managed to get it to work (its a bit of a bodge job but it was very easy and worked a treat on my PrestaShop™ 1.5.2.0)

 

  1. Ensure you have the Prestashop Google Analytics Module installed (my version was - Version : 1.8.1)
  2. Now Find the following file: /modules/ganalytics/views/templates/hook/header.tpl
  3. Open the header.tpl file in your preferred editor (see appendix 1 below for a view of my file before it was edited)
  4. Login to your adwords account and generate your custom conversion tracking code.
  5. Paste your Adwords conversion code at the bottom below the closing analytics script tag. (See my example - appendix 2)
  6. Change this parameter within your adwords conversion tracking code: var google_conversion_value = {$trans.total};
  7. Save and push the file live
  8. Do a test transaction to make sure you haven't made a fatal error
  9. Watch the data appear in your adwords account (It takes about an hour from when your first order was placed.

Hope that helps (Please note: im a bodger, not a developer)

 

 

Appendix 1

 

{*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2014 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
    {if $universal_analytics eq true}
    {literal}
    (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');
    {/literal}

    ga('create', '{$ganalytics_id|escape:'htmlall':'UTF-8'}'{if isset($pageTrack)}, '{$pageTrack|escape:'htmlall':'UTF-8'}'{/if});

    {if $isOrder eq true}
    ga('require', 'ecommerce', 'ecommerce.js');
    {else}
    ga('send', 'pageview');
    {/if}

    {if $isOrder eq true}
    ga('ecommerce:addTransaction', {
        'id': '{$trans.id|escape:'htmlall':'UTF-8'}',
        'affiliation': '{$trans.store|escape:'htmlall':'UTF-8'}',
        'revenue': '{$trans.total|escape:'htmlall':'UTF-8'}',
        'tax': '{$trans.tax|escape:'htmlall':'UTF-8'}',
        'shipping': '{$trans.shipping|escape:'htmlall':'UTF-8'}',
        'city': '{$trans.city|escape:'htmlall':'UTF-8'}',
        'state': '{$trans.state|escape:'htmlall':'UTF-8'}',
        'country': '{$trans.country|escape:'htmlall':'UTF-8'}',
        'currency': '{$trans.currency|escape:'htmlall':'UTF-8'}'
    });

    {foreach from=$items item=item}
    ga('ecommerce:addItem', {
        'id': '{$item.OrderId|escape:'htmlall':'UTF-8'}',
        'sku': '{$item.SKU|escape:'htmlall':'UTF-8'}',
        'name': '{$item.Product|escape:'htmlall':'UTF-8'}',
        'category': '{$item.Category|escape:'htmlall':'UTF-8'}',
        'price': '{$item.Price|escape:'htmlall':'UTF-8'}',
        'quantity': '{$item.Quantity|escape:'htmlall':'UTF-8'}'
    });
    {/foreach}
    {literal}
    (function() {
        {/literal}{if $isOrder eq true}{literal}
            var key = 'ga_trans';
            var idtrans = {/literal}{$trans.id|intval}{literal};
            if (!!$.prototype.totalStorage)
                var view_ga_trans = parseInt($.totalStorage(key));
            else if (typeof localStorage !== 'undefined' && localStorage)
                var view_ga_trans = parseInt(localStorage.getItem(key));

            if (typeof view_ga_trans !== 'undefined' &&  view_ga_trans > 0 && idtrans == view_ga_trans )
                return false;

            if (!!$.prototype.totalStorage)
                $.totalStorage(parseInt(key, idtrans));
            else if (typeof localStorage !== 'undefined' && localStorage)
                localStorage.setItem(key, parseInt(idtrans));
        {/literal}{/if}{literal}
        ga('ecommerce:send');
    })();
    {/literal}
    {/if}
    {else}
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', '{$ganalytics_id|escape:'htmlall':'UTF-8'}']);
    // Recommended value by Google doc and has to before the trackPageView
    _gaq.push(['_setSiteSpeedSampleRate', 5]);

    _gaq.push(['_trackPageview'{if isset($pageTrack)}, '{$pageTrack|escape:'htmlall':'UTF-8'}'{/if}]);

    {if $isOrder eq true}            {* If it's an order we need more data for stats *}
    _gaq.push(['_addTrans',
        '{$trans.id|escape:'htmlall':'UTF-8'}', {* order ID - required *}
        '{$trans.store|escape:'htmlall':'UTF-8'}', {* affiliation or store name *}
        '{$trans.total|escape:'htmlall':'UTF-8'}', {* total - required *}
        '{$trans.tax|escape:'htmlall':'UTF-8'}', {* tax *}
        '{$trans.shipping|escape:'htmlall':'UTF-8'}', {* shipping *}
        '{$trans.city|escape:'htmlall':'UTF-8'}', {* city *}
        '{$trans.state|escape:'htmlall':'UTF-8'}', {* state or province *}
        '{$trans.country|escape:'htmlall':'UTF-8'}' {* country *}
    ]);

    {foreach from=$items item=item}
    _gaq.push(['_addItem',
        '{$item.OrderId|escape:'htmlall':'UTF-8'}', {* order ID - required *}
        '{$item.SKU|escape:'htmlall':'UTF-8'}', {* SKU/code - required *}
        '{$item.Product|escape:'htmlall':'UTF-8'}', {* product name *}
        '{$item.Category|escape:'htmlall':'UTF-8'}', {* category or variation *}
        '{$item.Price|escape:'htmlall':'UTF-8'}', {* unit price - required *}
        '{$item.Quantity|escape:'htmlall':'UTF-8'}' {* quantity - required *}
    ]);
    {/foreach}
    {* submits transaction to the Analytics servers *}
    {literal}
    _gaq.push(['_trackTrans']);
    {/literal}
    {/if}
    {literal}
    (function() {
        {/literal}{if $isOrder eq true}{literal}
            var key = 'ga_trans';
            var idtrans = {/literal}{$trans.id|intval}{literal};
            if (!!$.prototype.totalStorage)
                var view_ga_trans = parseInt($.totalStorage(key));
            else if (typeof localStorage !== 'undefined' && localStorage)
                var view_ga_trans = parseInt(localStorage.getItem(key));

            if (typeof view_ga_trans !== 'undefined' &&  view_ga_trans > 0 && idtrans == view_ga_trans )
                return false;

            if (!!$.prototype.totalStorage)
                $.totalStorage(parseInt(key, idtrans));
            else if (typeof localStorage !== 'undefined' && localStorage)
                localStorage.setItem(key, parseInt(idtrans));
        {/literal}{/if}{literal}

        var ga = document.createElement('script');
        ga.type = 'text/javascript';
        ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(ga, s);
    })();
    {/literal}
    {/if}
</script>

 

 

 

 

Appendix 2: (My adwords code with my ID's removed)

<!-- START Google Code for Order Conf Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = YOUR ID HERE;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "YOUR LABEL HERE";
var google_conversion_value = {$trans.total};
var google_conversion_currency = "GBP";
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/YOURVALUE/?value=0.00&currency_code=GBP&label=YOURLABEL&guid=ON&script=0"/>
</div>
</noscript>
<!-- END Google Adwords Code for Order Conf Conversion Page -->
 

Link to comment
Share on other sites

  • 2 weeks later...

Hello all,

 

I am using PS 1.6.0.14. I have inserted the code AdWords in order-confirmation.tpl, at the end of file, after {/if}, as someone wrote here few posts before, but this does not work for me, the conversions are not reported. I have tested it with Tag Assistant by Google in Chrome and the reported error was "No HTTP response detected". So, seams that inserting the AsWords trancking code in the order-confirmation.tpl is not working.

 

As for the solution of nematodesdirect, is there anybody which did test it on PS 1.6.0.14? IS it working in this version? Anyway, if this is working, it will report all the conversions, not only when an order is finished.

 

Tks to all...

Link to comment
Share on other sites

  • 4 weeks later...

Hi, I received the following message from google

 

"So how conversion tracking works in Adwords is when you implement the adwords conversion tracking code on your checkout complete page or "thank you" page then every time a customer clicks your Adwords ad on Google.com or selected Google Network sites, a temporary cookie is placed on the customer's device so a conversion can be recorded when the customer reaches the conversion page and your conversion tracking code is executed so this tracks your conversion and reports it in to your adwords account.

 

Here is a helpful video explaining conversion tracking too : https://youtu.be/TgNI5Yavdig

 

If you are already using Google Analytics on the site you should consider setting up a Goal instead as this will run off your existing google analytics code so no modification would be required to the site.

 

then once you have linked your adwords and analytics account you can import the adwords goals from analytics.

 

More information on Goals can be found here: https://support.google.com/analytics/answer/1012040?hl=en

 

 

 

And for information on Goal creation please see this link: https://support.google.com/analytics/answer/1032415

  • Like 1
Link to comment
Share on other sites

  • 9 months later...

thanks @khejit68 & @anitam . i have copied in code and have analytics set up. so i think i have the google_conversion_value set up. google tag manager says it isnt working but i think that its because the script code is not in the header. is this correct? 

is there a way to use google analytics to include: google_conversion_value so that the conversion is set up in google analytics and i can put in the variable: google_conversion_value?? thank you.

Link to comment
Share on other sites

  • 9 months later...
  • 2 weeks later...

Sorry but i have the same probleme: (Prestashp 1.6)

 

I got 2 Codes from Google to add

 

1) Tracking Code:

<script>
  (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','https://www.google-analytics.com/analytics.js,ga');

  ga('create', 'XXXXXXXXXXXX', 'auto');
  ga('send', 'pageview');

</script>
 

 

2) DNS Text:
<meta name="google-site-verification" content="XXXXXXXXXXXXXXXXXXXXXXXXXXX" />

 

Where and how do i add both of them (or in diffent files)?

 

I hope you can help me, 10 houres i am trying - nothing!!

 

greetings Mike

Edited by Aquis President (see edit history)
Link to comment
Share on other sites

  • 2 years later...

Hi,

in Prestashop 1.7.2.2 I'm trying to set the "add to cart" as a conversion on GoogleAds. After having added the snippet in the <head> I also added the code to the button (trying the two ways below) but the clicks are not detected. Where am I wrong?
https://support.google.com/google-ads/answer/6331304?hl=it

<button onclick = "goog_report_conversion ()" class = "button-action slide-button" action-button-data = "add-to-cart" type = "submit" {if! $ product.quantity} disabled {/ if} >
<button onclick = "goog_report_conversion (ls = 'Add to cart')" class = "button-action slide-button" data-button-action = "add-to-cart" type = "submit" {if! $ product. quantity disabled} {/ if}>

Thank you

K

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...