Jump to content

Google Analytics - HowTo


Recommended Posts

I love details and I love WHMCS.

 

If you would like to be able to track your pages through Google Analytics you can do so by simply editing the header.tpl file in your templates folder.

 

I use Portal mode so for me it is /templates/portal/header.tpl

 

Near the top of the page you will want to insert the following code

 

<script src="http://wxwxwx.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript"> _uacct = "XX-XXXXXXX-X"; urchinTracker(); </script>

 

Where XX-XXXXXXX-X is your Google Analytics tracking number. Once you have done this you will then need to visit Google Analytics page and set up your goals. Even though each page shares the same header it is tracked uniquely by the page name such as order.php etc.

 

Also remove the "x"s in the wxwxwx portion...I don't quite have 15 posts so it won't let me put the clean URL there. Maybe a moderator will fix this for me.

 

To find where you would like to set your goals simply run through the checkout process and make a note of all the URLs in the process and you can set those up on Google Analytics.

 

I hope this helps you with tracking your conversion rates.

 

- DC

Link to comment
Share on other sites

  • 2 weeks later...
Dont forget that you need to link to the https version for your checkout area if you use ssl, if not, its going to give errors your users.

 

Does that mean that I need to create 2 diffrent profiles in Google Analytics panel??

 

One for http and one for https?

 

Regards.

Link to comment
Share on other sites

Dont forget that you need to link to the https version for your checkout area if you use ssl, if not, its going to give errors your users.

 

Does that mean that I need to create 2 diffrent profiles in Google Analytics panel??

 

One for http and one for https?

 

Regards.

All you have to do is change the URL for the script source in your footer to:

 

https://ssl.google-analytics.com/urchin.js

 

And you'll be good to go.

Link to comment
Share on other sites

uberhost,

 

Thanks for your reply.

 

It make sense because I see on your site that you are using SSL version of code even on non-SSL pages.

 

I have for now only placed code in 'order-complete.tpl template file'.

 

However, I don't know if I need to add some special tags.

 

My code there look like this:

 


 

I will appreciate your answer.

Link to comment
Share on other sites

As for your code, can you repost?

 

Here it is:

 


[b]»{$LANG.orderconfirmation}[/b]</p>



{$LANG.orderreceived}</p>

<blockquote>


{$LANG.ordernumberis} {$ordernumber}</p>
</blockquote>



{$LANG.orderfinalinstructions}</p>

{if $invoiceid}<p align="center">[url="viewinvoice.php?id={$invoiceid}"]{$LANG.invoicenumber}{$invoiceid}[/url]</p>{/if}

<p align="center">[url="clientarea.php"]{$LANG.ordergotoclientarea}[/url]</p>
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "xxxxxx";
urchinTracker();
</script>

 

I think that it works, but I can't see any result in statistic for about 24 hours.

Link to comment
Share on other sites

  • 8 months later...
All you have to do is change the URL for the script source in your footer to:

 

https://ssl.google-analytics.com/urchin.js

 

And you'll be good to go.

I have used the https version of the Analytics tracking code, but I still get a security warning. But, it is only in IE!

 

If I remove the code completely, the warning goes away which proves my SSL is setup correctly with my host account.

 

How can I avoid the warning?

Link to comment
Share on other sites

I have used the https version of the Analytics tracking code, but I still get a security warning. But, it is only in IE!

 

If I remove the code completely, the warning goes away which proves my SSL is setup correctly with my host account.

 

How can I avoid the warning?

 

It may not be related to the Google Analytics code, have you tried removing the code to see if the warning persists? Also, if you can provide a link to your site that would help us troubleshoot.

 

Best,

Rick

Link to comment
Share on other sites

Without sounding patronising, have you ensured that all images etc ARE on the same machine/secured domain that your cart is (preferably in the WHMCS folder tree somewhere)?

 

The best way to see is to use IE and then tell it to not load the insecure items, then have a good scour to see what's missing.

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