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&guid=ON&script=0"/>
</div>
</noscript>
In case the affects anything...
Our credit card checkout is through PayPal Payment Pro, and we also have activated normal PayPal checkout. Thx.
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)
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?.. :)
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!
no! index.html is just a placeholder file
as I said -- in the order_done.php
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.
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?
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
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.
Ok, take a peak at this screenshot. Am I getting closer?
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.
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 \'
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.
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';
My programmer was finally able to look into it, and did a simple fix of ending the php with "?>" (not the quotes, just the ?>)so that the html could be placed and it seems to be tracking fine now.
Thanks for all of your help, GJC, and patience with my limited knowledge. Just posting the above in case another novice comes along and may need some php 101 help.