Jump to content

whmcs and google analytics?


pod

Recommended Posts

found the problem:

 

you can use: <script type="text/javascript">

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

var pageTracker = _gat._getTracker("UA-xxxxxxx-1");

pageTracker._trackPageview();

pageTracker._addTrans( "{$orderid}", "", "{$amount}", "0", "0", "{$city}", "{$state}", "{$country}" );

pageTracker._addItem( "{$orderid}", "{$packageid}", "{$name}", "{$type}", "{$amount}","1" );

pageTracker._trackTrans();

</script>

 

 

 

 

it must be two script tags:

 

 

 

<script type="text/javascript">

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

</script>

<script type="text/javascript">

var pageTracker = _gat._getTracker("UA-xxxxxxx-1");

pageTracker._trackPageview();

pageTracker._addTrans( "{$orderid}", "", "{$amount}", "0", "0", "{$city}", "{$state}", "{$country}" );

pageTracker._addItem( "{$orderid}", "{$packageid}", "{$name}", "{$type}", "{$amount}","1" );

pageTracker._trackTrans();

</script>

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
I have impression that my code is correct buy Google Analytics is tracking nothing...

 

Could somebody please check my website?

http://clientes.virtualorbis.com

 

I followed the wiki instructions...

 

Hi,

 

As I could see some tags are missing in the code. So, I'll suggest you to copy paste the code from wiki as it is, and just update/replace this code - ("UA-xxxxx-x")

 

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
{literal} try {
var pageTracker = _gat._getTracker("UA-[color="red"]xxxxx-x[/color]");
pageTracker._trackPageview();
} catch(err) {} {/literal}
</script>

 

 

This will save you from typos and all.

 

@honesting

 

Original code from analytics gives you in two separate script forms. You need to merge those in single script as shown in wiki. That's only the difference, I can see.

Link to comment
Share on other sites

  • 3 weeks later...

I did all this. Followed the instructions from the manual, and had 3 orders placed, but none are showing up in google. I even did a test and viewed the source code and saw the variables being generated.

 

And yes I have my proper UA code inserted. Any ideas?

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