News:

Looking for documentation? Take a look on our wiki

Main Menu

Conversion Tracking/Checkout (Google and Facebook)

Started by alinajenon, October 19, 2015, 19:57:34 PM

Previous topic - Next topic

alinajenon

VM: 2.6.10 / Joomla: 2.5.27

I have been trying to figure out how to add Google and Facebook tracking code to the checkout thank you page with little success. Google says to place it between the <body> tags of the page you want to track. I apologize as I'm not much of a coder, so the answer might be obvious and I'm just overlooking it.

I know how to find the order_done.php file (and have tried placing code there), but I believe I need more of an html file? since google suggests putting it between the <body> tags. And this is where I have a big gap in basic coding. I'm not sure where to find a file that has the html for the checkout/order_done page.

Any suggestions? Thank you!

Below is the google code:

<!-- Google Code for Purchase Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 980318407;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "4aiCCP3t02AQx_G50wM";
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/980318407/?label=4aiCCP3t02AQx_G50wM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

alinajenon

In case the affects anything...

Our credit card checkout is through PayPal Payment Pro, and we also have activated normal PayPal checkout. Thx.

alinajenon

Would I maybe add it to the index.html file here, same file where order_done.php resides? *see attached image

(components>com_virtuemart>views>cart>tmpl>index.html)

GJC Web Design

it doesn't matter at all WHERE on the page it is and order_done is the correct page..  just suck and see...  what's the worst that can happen?..  :)
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

alinajenon

Ok, I'll try on the index.html file ... I did try on the order_done.php file with no luck. I'll let you know how it goes!

GJC Web Design

no! index.html is just a placeholder file

as I said -- in the order_done.php
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

alinajenon

Oh, ok. I had already tried the order_done.php without any success (for both facebook and google tracking code).  Go to know I can eliminate the index.html option.

alinajenon

So this (see attachment) is how I have the code pasted into the order_done.php file without any success of being tracked. Any suggestions?

GJC Web Design

1st prove this is the page you arrive at when your order is confirmed

2nd. your pasting html into a php file!!!!!!!

you need to echo it out
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

alinajenon

Hi, this is why I mentioned I'm a novice at this and have a knowledge gap. I knew it didn't seem right. Do you have any suggestions on where I can look to learn how to "echo it out". And I am 99% sure it is the correct page... based on much digging through all my files, checking the language of the page to file, and what I've read on other forums/sites.

Thanks for your leads so far. It's the furthest I've gotten. I'll look up echoing php into html and see if I have any success.

alinajenon

Ok, take a peak at this screenshot. Am I getting closer?

alinajenon

Well, the above code "broke" the page (just got a blank white page when testing checkout). At least I know I have the correct page! But now I need to figure out the correct code placement.

GJC Web Design

of course..  you have a mixture of double and single quotes .. you can see the problems immediately from your screen code highlighting

escape the single quotes  \'
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

alinajenon

Yes. I'm sorry, I KNOW these are very unknowledgeable and basic questions... but if you have a moment, can you point out what is highlighted in the code? and what you mean by "escape the single quotes /' "? I prob don't have enough basic programming knowledge for this forum... I'm just not sure where else to turn. Thank you for all you've offered so far.

GJC Web Design

This is really basic php ...  if you have echo 'blah';

then u can't have ' in the string

escape them

echo 'blah can\'t have a \' in the string';
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation