Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 6th Jul 2010, 03:54 AM   #1
Active Warrior
 
Join Date: 2010
Posts: 81
Thanks: 11
Thanked 0 Times in 0 Posts
Default
problem with javascript and google analytics...
Share on: 
fb share twitter share gplus share more share

i'm trying to add google anlytics. i added the code as such, but the tracking status isn't active. and idea what i can do to make it active?

my code (yes the page just redirects, but i'd still like analytics):

<html>
<head>
<title>Drug T-shirts</title>
<script type="text/javascript">
<!--
function delayer(){
window.location = "http://www. affiliate link"
}
//-->
</script>



<script type="text/javascript">

google analytics code

</script>




</head>
<body onLoad="setTimeout('delayer()', 1)">


</body>
</html>
csrpj is offline  
Unread 6th Jul 2010, 04:00 AM   #2
Freelance Warrior
 
iBBnet's Avatar
 
Join Date: 2009
Location: USA
Posts: 246
Thanks: 1
Thanked 13 Times in 13 Posts
Default
Re: problem with javascript and google analytics...
Share on: 
fb share twitter share gplus share more share

When I setup my Google Analytics, I had to wait for a couple of days for the tracking to become active. Maybe you just need to wait a little longer and see what happens...

Bryan
After5PC.net
Freelance Web Development
and Graphic Design Services
iBBnet is offline  
Unread 12th Jul 2010, 04:22 PM   #3
Ellistev
 
Join Date: 2010
Location: Saskatoon, SK
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: problem with javascript and google analytics...
Share on: 
fb share twitter share gplus share more share

Is it working now?

Steven Elliott
William Joseph Communications
Sasktoon's Premier Marketing Firm
http://saskatoon.williamjoseph.ca
ellistev is offline  
Unread 12th Jul 2010, 04:45 PM   #4
VIP Warrior
War Room Member
 
ereadergold's Avatar
 
Join Date: 2008
Location: Montreal Canada
Posts: 2,390
Thanks: 1,017
Thanked 836 Times in 572 Posts
Blog Entries: 1
Default
Re: problem with javascript and google analytics...
Share on: 
fb share twitter share gplus share more share

I would try setting up a test page, a very simple HTML page that does nothing except hold the Analytics code. Put it on your site and see if it works correctly.

Once you confirm it works use the same code on the page you show here. If it doesn't work my guess is that because you call the "delayer" function as soon as the body loads the Analytics code never gets the chance to run.

With the test page you should be able to determine pretty quickly if that is the case.


Bill
ereadergold is offline  
Unread 12th Jul 2010, 06:16 PM   #5
Warrior Member
 
Join Date: 2010
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default
Re: problem with javascript and google analytics...
Share on: 
fb share twitter share gplus share more share

Try placing it before the ending body tag... That's what I always do and it works perfectly... Also, try recopying your analytics code to your site. Some times that fixes that issue as well.
Juturna is offline  
Closed Thread


Bookmarks

Tags
analytics, google, javascript, problem


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 08:27 PM.