I need to add google tracking code in the head tag of either the thank you page or the order confirmation page. I've downloaded the com_virtualmart folder from the server but there's so many files to look thru I'm not even sure where to look or what to look for. Please help, thanks.
Hi ScottKR24,
you can put it on this page
/components/com_virtuemart/views/cart/tmpl/order_done.php
This page appears once the order has been placed successfully.
I hope this helps.
yes the order_done.php is the right place for the tracking code but there is not much information about the bought products.
I have just few info about the shipping method, paymentmethod, and the total prices and taxes.
Would be nice to know how to get product information for this order...
Google tracking code:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'1234', // order ID - required
'Acme Clothing', // affiliation or store name
'11.99', // total - required
'1.29', // tax
'5', // shipping
'San Jose', // city
'California', // state or province
'USA' // country
]);
// add item might be called for every item in the shopping cart
// where your ecommerce engine loops through each item in the cart and
// prints out _addItem for each
_gaq.push(['_addItem',
'1234', // order ID - required
'DD44', // SKU/code - required
'T-Shirt', // product name
'Green Medium', // category or variation
'11.99', // unit price - required
'1' // quantity - required
]);
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
(function() {
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);
})();
</script>
Hi KarlRanseier,
You should still have the order id when you're on that page. Why not write a query to grab the products from the order. I think the code is already written, you just need to target it.
I hope this helps. ;D
Please tell me how to get the order id inside order_done file.
Thank you.
Quote from: berghoff on August 16, 2012, 13:39:47 PM
Please tell me how to get the order id inside order_done file.
Thank you.
Hey Berghoff !
If you can wait 24-48h, I'll tell you how to do.
I have to implement some custom functions in this page tomorrow for my own project.
Once I know more, I explain how.
ivus, thanks for this information
Can we be sure that this page is the good one ?
I mean.. What if customer pay on the bank website and never get back to the store !?
After the payment is processed on the bank-side. Notification can be sent back to your site with POST.
This page is the best if you want to do the same operation for all payment types.
Waiting for your notes FederA.
Hum, sorry men, finally i did something else.
I just use the url
cart/confirm
Exactly HOW do I put the Adwords Javascript into "order_done.php"?
I guess I can't just past it in the end since that creates an error. I would very much appreciate a sample page.
Thanks,
Elias
whats the code first of all?
You probably are just not doing it right.
Hi there. I have the same question. Although, my code is a facebook conversion tracking which should work the same way. I know that the best way to implement it in the order confirmation page. My problem is how do I properly insert the code?
I have currently implemented like this:
echo '<script type="javascript">
some variables...
</script>
<script language="javascript" src="https://www.facebook.com/xxxxxxxxxtracker.js">';
However, nothing is being captured.
Please help.
Thank you in advance.
I have actually inserted the code like this:
Quote from: PRO on March 15, 2013, 18:32:26 PM
whats the code first of all?
You probably are just not doing it right.
I have actually inserted the code like this:
echo '<script type="javascript">
var a = "123";
var b = "456";
var c = "789";
</script>
<script language="javascript" src="https://www.facebook.com/xxxxxxxxxtracker.js">';
Even though, their syntax is like this:
echo '<script type="javascript">
var a = '123';
var b = '456';
var c = '789';
</script>
<script language="javascript" src="https://www.facebook.com/xxxxxxxxxtracker.js">';
I might not have written it properly. That's the only way it's not giving me an error. Also, how would I insert another similar tracking code? Your help will be greatly appreciated.
Thanks.
So did you try to insert this code or you did not?
Quote from: Maxim Pishnyak on September 15, 2013, 13:12:53 PM
So did you try to insert this code or you did not?
I did. However, nothing was tracking. So I thought I did something wrong, that's why I posted a question. Did I properly insert the code? The echo, single quotes and stuff...
Thanks.
I need url to your web site and url to the page from where you got tracking codes.
Quote from: Maxim Pishnyak on September 16, 2013, 04:48:26 AM
I need url to your web site and url to the page from where you got tracking codes.
Max, I replied you in the other post. Here's the URL to the other post for anybody having similar issue: http://forum.virtuemart.net/index.php?topic=116788.0
I am sorry for having this issue discussed in two different posts. I did not initially start either of them; I was just replying with my own questions.
Thanks.
Quote from: romatvirtue on September 07, 2013, 23:29:32 PM
I have currently implemented like this:
Did you try to use
?>
...your code here...
<?php
?
Quote from: Maxim Pishnyak on September 18, 2013, 10:13:58 AM
Quote from: romatvirtue on September 07, 2013, 23:29:32 PM
I have currently implemented like this:
Did you try to use
?>
...your code here...
<?php
?
Max, that's exactly how I did it. Did you get a chance to go through the checkout?
Quote from: romatvirtue on September 18, 2013, 22:44:59 PM
Did you get a chance to go through the checkout?
Could you pm me a tips how I could do this?