Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Google Adwords Conversion Code - 4.1.4 Rate Topic   - - - - -

 

Posted 10 November 2014 - 02:28 AM #1

G'Day All,

Age is getting the better of me and I can't for the life of me figure the following out:
I'm trying to place the google adwords code into order confirmation page.

/design/themes/basic/templates/views/checkout/complete.tpl

{* place any code you wish to display on this page right after the order has been placed *}
  {hook name="checkout:order_confirmation"}
   <!-- Google Code for Google Adwords - Purchase Conversion Page -->
{literal}  
<script type="text/javascript">
	/* <![CDATA[ */
	var google_conversion_id = 11111111111;
	var google_conversion_language = "en";
	var google_conversion_format = "3";
	var google_conversion_color = "ffffff";
	var google_conversion_label = "1111111111111";
	var google_conversion_value = {/literal}{$order_info.total}{literal};
	var google_conversion_currency = "AUD";
	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/1111111111111/?value={/literal}{$order_info.total}{literal}&amp;currency_code=AUD&amp;label=1111111111111&amp;guid=ON&amp;script=0"/>
	</div>
	</noscript>
{/literal}
{/hook}


I've moved on from CS-Cart to WooC******** - If you need anything I can be of little help.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 10 November 2014 - 05:18 AM #2

Someone has probably used an override for that hook. Best to use a post hook rather than embedding in a distributed template.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 

Posted 10 November 2014 - 09:22 AM #3

Someone has probably used an override for that hook. Best to use a post hook rather than embedding in a distributed template.


Hi Tony,

so I'm assuming I should create the following file:
order_confirmation.post.tpl
under

/design/themes/basic/templates/addons/my_changes/hooks/checkout
Using the same code as shown above?
I've moved on from CS-Cart to WooC******** - If you need anything I can be of little help.

 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2629 posts

Posted 10 November 2014 - 03:31 PM #4

Well look who's back. How are things down under?

Yes, that is the file and location that you'd want to use. I did my code a bit different though.

<!-- Google Code for Purchase Conversion Page -->
    <script type="text/javascript">
{literal}
    /* <![CDATA[ */
    var google_conversion_id = 1234567890;
    var google_conversion_language = "en_US";
    var google_conversion_format = "1";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "Purchase";
    if (10.0) {
        var google_conversion_value = 10.0;
        var google_conversion_currency = "USD"
    }
    /* ]]> */
{/literal}
    </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=10.0&label=Purchase&guid=ON&script=0">
    </noscript>

<!-- End Google Code for Purchase/Sale Conversion Page -->

Thanks,

Brandon

 
  • Tim Hensel
  • Junior Member
  • Members
  • Join Date: 01-Mar 11
  • 237 posts

Posted 10 November 2014 - 04:47 PM #5

I'm surprised this is not completely standard now with CS-Cart 4.x??
- CS-Cart 2.2.5 Pro Store -

 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2629 posts

Posted 11 November 2014 - 03:30 AM #6

Why would it be? I don't use Adwords. Most of my clients also don't. Actually, out of all of my clients, I think only like 4 stores use Adwords.

 
  • CartBooster
  • Senior Member
  • Members
  • Join Date: 25-Jun 06
  • 237 posts

Posted 12 November 2014 - 12:37 AM #7

Let me know how you get along,

We've had terrible trouble with this since upgrading

www.cartbooster.ie


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 12 November 2014 - 12:44 AM #8

What kind of trouble. This hook has worked flawlessly since its inception. Are you getting errors in your browser console? If so, what are they? If not, maybe you could describe your problem.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • CartBooster
  • Senior Member
  • Members
  • Join Date: 25-Jun 06
  • 237 posts

Posted 12 November 2014 - 12:57 AM #9

Our adword campaigns don't seem to be tracked since moving to 4.1.5
so we can't see what ads are being targeted correctly,

I've just modified the code below
{* place any code you wish to display on this page right after the order has been placed *}
{hook name="checkout:order_confirmation"}
to:


        {literal}  
        <script type="text/javascript">
                /* <![CDATA[ */
                var google_conversion_id = XXXXXXXXXX;
                var google_conversion_language = "en";
                var google_conversion_format = "3";
                var google_conversion_color = "ffffff";
                var google_conversion_label = "Purchase";
                var google_conversion_value = {/literal}{$order_info.total}{literal};
                var google_conversion_currency = "EUR";
                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/XXXXXXXXXX/?value={/literal}{$order_info.total}{literal}&amp;currency_code=EUR&amp;label=Purchase&amp;guid=ON&amp;script=0"/>
                </div>
                </noscript>
        {/literal}


Obviously XXXXXXXXXXX is the conversion code of the client,
I'll try see does this work with adwords now, ( can take 24 hours to update )

The code seems to appear on the checkout page correctly,

www.cartbooster.ie


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 12 November 2014 - 01:06 AM #10

If you used the hook instead of putting your code in the main template then your changes would still be there after you upgraded. That's the whole point of using hooks; so your changes are preserved.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • CartBooster
  • Senior Member
  • Members
  • Join Date: 25-Jun 06
  • 237 posts

Posted 12 November 2014 - 01:10 AM #11

Thanks, Will move it into the hook in my changes addon, fingers crossed the new code will work, thanks,

www.cartbooster.ie


 

Posted 14 November 2014 - 03:35 PM #12

Tried it, doesn't appear to work.

Not saying it should be turned on by default but it would be bloody useful to have as a quick addon.
I've moved on from CS-Cart to WooC******** - If you need anything I can be of little help.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 15 November 2014 - 12:49 AM #13

Works for me and countless others.... Is the problem that the hook is not showing in the page source? Or is the problem that Google is not receiving/processing it properly?

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 

Posted 19 November 2014 - 07:44 AM #14

Works for me and countless others.... Is the problem that the hook is not showing in the page source? Or is the problem that Google is not receiving/processing it properly?


Honestly, no bloody idea. Starting to wonder where everything is going wrong.
The code doesn't show in view source, and that's half the problem, so placing fake orders gets old when actual works needs to be done.

Here's my setup:

My Changes : Installed.
/design/themes/basic/templates/addons/my_changes/hooks/checkout/order_confirmation.post.tpl

Contents:
<!-- Google Code for Google Adwords - Purchase Conversion Page -->
		{literal}  
		<script type="text/javascript">
				/* <![CDATA[ */
				var google_conversion_id = XXXXXXXXX;
				var google_conversion_language = "en";
				var google_conversion_format = "3";
				var google_conversion_color = "ffffff";
				var google_conversion_label = "Purchase";
				var google_conversion_value = {/literal}{$order_info.total}{literal};
				var google_conversion_currency = "AUD";
				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/XXXXXXXXX/?value={/literal}{$order_info.total}{literal}&amp;currency_code=AUD&amp;label=Purchase&amp;guid=ON&amp;script=0"/>
				</div>
				</noscript>
		{/literal}

If anything looks completely out of place, let me know, I'm getting old.
I've moved on from CS-Cart to WooC******** - If you need anything I can be of little help.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 19 November 2014 - 08:46 PM #15

If you have cleared your cache after creating this order_confirmation.post.tpl file then you should in fact see your code (even if the code is wrong) in a view source of the checkout.complete page.

I do not see anything wrong with what you've posted.

Verify that the my_changes addon is "active" (it is disabled by default in V4) and verify that the cache is in fact clearing (I.e. you don't have ownership/permission problems on your site).

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 

Posted 08 August 2015 - 12:29 PM #16

/design/themes/basic/templates/addons/my_changes/hooks/checkout/order_confirmation.post.tpl

Does the theme directory need to be related to the theme which you're using? For example, I'm using a theme called Spark. Should I put it in the directory /design/themes/spark/.....?

Thanks

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 08 August 2015 - 06:58 PM #17

Yes

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Bob53207
  • Newbie
  • Trial users
  • Join Date: 10-Mar 16
  • 2 posts

Posted 11 March 2016 - 10:09 PM #18

Honestly, no bloody idea. Starting to wonder where everything is going wrong.
The code doesn't show in view source, and that's half the problem, so placing fake orders gets old when actual works needs to be done.

Here's my setup:

My Changes : Installed.

/design/themes/basic/templates/addons/my_changes/hooks/checkout/order_confirmation.post.tpl
Contents:
<!-- Google Code for Google Adwords - Purchase Conversion Page -->
		{literal}  
		<script type="text/javascript">
				/* <![CDATA[ */
				var google_conversion_id = XXXXXXXXX;
				var google_conversion_language = "en";
				var google_conversion_format = "3";
				var google_conversion_color = "ffffff";
				var google_conversion_label = "Purchase";
				var google_conversion_value = {/literal}{$order_info.total}{literal};
				var google_conversion_currency = "AUD";
				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/XXXXXXXXX/?value={/literal}{$order_info.total}{literal}&amp;currency_code=AUD&amp;label=Purchase&amp;guid=ON&amp;script=0"/>
				</div>
				</noscript>
		{/literal}
If anything looks completely out of place, let me know, I'm getting old.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

although I have the 'My changes' add-on activated, I do not see it when going to /design/themes/basic/templates/addons/  I can find the find the file in \yotpo\hooks\checkout  and also \google_analytics\hooks\checkout  Which (if any) should the AdWords code be placed?



 

Posted 22 April 2016 - 10:09 PM #19

Can somone please advise on how to have the google conversion code to work?

I am using buyshop theme

I have been placing it using a hook under /mydomain.com/design/themes/buyshop/templates/addons/my_changes/hooks/checkout as order_confirmation.post.tpl

google team was unable to help...they said the hook is not working...

please let me know if you need more info to help

thank you



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10770 posts

Posted 22 April 2016 - 10:44 PM #20

If the hook is not being called, then you will have to contact the vendor of your theme to find out why.  It would be very strange for a cs-cart theme vendor NOT to support the order_confirmation.post.tpl hook since that would break a ton of things.

What is the content of your order_confirmaiton.post.tpl file:

 

Enabling the Google Analytics addon and entering the appropriate credentials should be all you need for conversion code.  You shouldn't have to add anything yourself.  Are you sure you have your credentials set properly?


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.