Jump to content

Setting up Google Analytics for order form etc.


rbro

Recommended Posts

I'm trying to add the Google Analytics tracking code to my order form and I saw a few different threads on the matter, but I think they've changed the code recently and I want to do it the right way. There's a help document here:

 

http://www.google.com/support/googleanalytics/bin/static.py?page=troubleshooter.cs&problem=tracking&selected=tracking_php&ctx=tracking_tracking_php_55504&aw_referral=#static

 

Is this essentially what I'm looking for? Is this the best way to add the code to and track the WHMCS order process?

Link to comment
Share on other sites

Be sure that if you're using SSL that you use the proper link (https://ssl.google-analytics.com/urchin.js) so that you don't cause a "mixed content" error with your security cert.

 

I had originally called all js from the https address - but looking at the new js from the OP above it seems that google now have ssl checking in their invocation code.

Link to comment
Share on other sites

I tried this earlier and was getting an SSL/Cert mismatch warning, but it seems to be working now (fingers crossed). What do identify as the conversion page if I'm using this method though? order-complete.tpl? Should I put the tracking code in there as well to identify that uniquely somehow?

Link to comment
Share on other sites

we use the static tracking code on our templates and it works fine

 

So are you uploading the analyticstracking.php file and all that, or just putting the code in footer.tpl like others have suggested? I can't seem to get my order form to track in GA yet and every time I try something else, I have to wait 24 hours to see if it shows up or not.........

Link to comment
Share on other sites

If anyone can clear this up for me I'd really appreciate it. I have seen 2 methods for getting this tracking to work. One involves adding the google code to the footer.tpl file as suggested by some in this thread and the other involves uploading a file called analyticstracking.php and then adding code to each .tpl file in the order form. Neither seems to work correctly for me. Does anyone know for sure? Google's help page says this:

 

"After you've uploaded analyticstracking.php to your site, add the following line to each template page before the closing </body> tag:

 

Alternatively, you can add the line above to an existing footer include file, which will place it in the correct area of the HTML document."

 

Unfortunately, the line that's supposed to be added is missing from the google help page. Can anyone who has this working properly throw me a bone here?

Link to comment
Share on other sites

OK, I think I have this tracking properly now. I added this to footer.tpl:

 

<?php

include('analyticstracking.php');

?>

 

Now what page do I define as the "completed order" page, so I can set up goals etc? I saw a number of threads on this but am unsure what is correct.

Link to comment
Share on other sites

  • 8 months later...

The analytics.php file referred to is part of a sample setup presented by Google, its only one possible way to set up the tracking. Pay careful attention to the existing threads on this topic and we should be able to come up with a consistent, working code set. As for the checkout steps, we'll just need to map them out and post results...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated