2 of 3
2
Google analytics with EE
Posted: 12 May 2008 08:42 AM   [ Ignore ]   [ # 19 ]  
Grad Student
Avatar
Rank
Total Posts:  78
Joined  05-23-2007

I had a similar problem with the new GA code. I was missing some traffic. This was due to the Google code not having the required code import. The reason I was getting some hits and not others was due to users having a cached version already from a previous site, the anlytics code would then be working.

I added the following line above the GA code:

<script type="text/javascript" src="http://www.google-analytics.com/ga.js">


Also as Mark has said place it as the last code within your body tag.

 Signature 

jameswhittaker.com
refreshingapps.com

EE : Flex : Flash : AIR : AJAX : PHP : RoR

Profile
 
 
Posted: 12 May 2008 08:49 AM   [ Ignore ]   [ # 20 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6563
Joined  04-15-2006

Hi PX,

You should be able to get the new tracking code if you log into the GA account and then copy it from the account settings. You will probably find that the code you have there is an older version although to tell the truth I don’t recognise it having been that although it may have been a while back. Anyway if you log in to the GA account then click on Edit under the settings column for the site that you need the code for then click on the Check Status link that should be on the top right of that section and at the bottom of the page that appears you should see Legacy Tracking Code and New Tracking Code.

If you copy-paste the New Tracking Code into your site then your problems should hopefully all go away. Also this should definitely go just before the </body> tag.

Hope that helps.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 12 May 2008 09:03 AM   [ Ignore ]   [ # 21 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6077
Joined  08-04-2002

Thanks Mark…I’ll have to get the Google login info from the client.

Profile
 
 
Posted: 12 May 2008 09:13 AM   [ Ignore ]   [ # 22 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6563
Joined  04-15-2006

No problems. Let us know how it goes although if your original code is pretty much the same except for needing to put in the numbers for your account then I would think that you can just place that in for now although possibly best to get it directly from Google just to make sure that they don’t have some really old GA account or something weird like that.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 12 May 2008 09:27 AM   [ Ignore ]   [ # 23 ]  
Lab Assistant
RankRank
Total Posts:  102
Joined  12-26-2005

Aftershock,

Interesting thought about the .js code being cached.  I will try that code on one area of my site to see if I notice any changes.  Now here’s a question, I have the following code to deliver multiple pages for each article.  Since there is really only one template for all of the pages, am I losing out on traffic?  I’ve noticed that some of the subsequent pages show in GA results but hardly any.  It is a little shocking that when there’s a multiple page article that most of the time folks don’t click on past the first page, wonder if there’s an issue here….


{if segment_4 == “” OR segment_4 == ‘P0’}
{image}
{body}
{/if}


{multi_field=“extended|page2|page3|page4|page5|page6|page7|page8|page9|page10”}
<div class=“paginate”>
{paginate}
<p>(Page {current_page} of {total_pages} pages for this article {pagination_links})</p>
{/paginate}</div>

Profile
 
 
Posted: 12 May 2008 12:26 PM   [ Ignore ]   [ # 24 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6077
Joined  08-04-2002

Mark…Got the new code and all is well…Thanks!

Profile
 
 
Posted: 12 May 2008 12:46 PM   [ Ignore ]   [ # 25 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6563
Joined  04-15-2006
PXLated - 12 May 2008 12:26 PM

Mark…Got the new code and all is well…Thanks!

No problem! wink Glad it’s all working now!! grin

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 13 May 2008 03:24 PM   [ Ignore ]   [ # 26 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  205
Joined  05-05-2008

The only reason Google says to place it at the end before the </body> tag is because of slow connections, you can place the script in the header and you will not suffer any results.

Also Google notes a difference between “unique” visits and repeat. Just my 2.5 cents.

 Signature 

Invoked Projects


Panic Coda EE Clips

ideas are sparked by ramblings of confused personage

Profile
 
 
Posted: 13 May 2008 03:30 PM   [ Ignore ]   [ # 27 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6563
Joined  04-15-2006

Very good point. Had never seen this help document before but just what I had read about peoples usage of it.

Nice catch WTHIGO.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 13 May 2008 03:35 PM   [ Ignore ]   [ # 28 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  205
Joined  05-05-2008

I was going to post the help doc, but i won’t lie… I was lazy and I’m on break from a lab in a CISCO class so I don’t have my links. Thanks for picking up my slack, err i mean looking it up!

 Signature 

Invoked Projects


Panic Coda EE Clips

ideas are sparked by ramblings of confused personage

Profile
 
 
Posted: 13 May 2008 03:59 PM   [ Ignore ]   [ # 29 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  335
Joined  01-25-2006

That does not make sense - I think Google have that back to front. I would think the reason for it to be at the bottom of the page is so that the page loads fully before the hit is counted. If you have the script in the top of the page and someone has a bad connection and keeps reloading the page because only a bit of it shows then you are going to get a hit each time - which is a false reading because that person did not see your whole page.

Which brings me back to coolstuffchannels 50% difference problem. If you have the GA tag in the bottom of the page you should get a more accurate reading unless your page doesn’t fully load properly - maybe there is a call out to a script on a different server, like a blogroll or something,that does not connect. That would explain the difference in GA and server hits.

 Signature 

“All men are equal. All men, that is, who possess umbrellas.” E.M. Forster 

Artscape and Santaballs
Chris O’Donoghue Chelsea Garden Designer
The Greenwich and District Narrow Gauge Railway Society
Croydon RFC

Profile
 
 
Posted: 13 May 2008 04:29 PM   [ Ignore ]   [ # 30 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  768
Joined  03-16-2002

Regarding the placement of the GA code, it largely depends on your goals: Putting the code at the top of the page will count more views of partically loaded pages as well, whereas the position at the end might miss some “fly by” visits. The longer the overall page load time, the bigger the difference can get.

So, if you are mostly interested only in counting “real” visits, it is often best to place the code at the end of the page. If you want to come most closely to the numbers your log files will tell you (or you have some advertisers you’d like to impress), the code should be places at the top (and therefore executed early on pageload). In addition, GA statistics will only work for users that do not disable JS in the browser. Therefore, undercounting is a normal behaviour.

Markus

(Hey, this is my 700. post ... hope it is helpful for someone grin )

Profile
 
 
Posted: 13 May 2008 04:34 PM   [ Ignore ]   [ # 31 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  335
Joined  01-25-2006

Well put Markus. Of course the server logs count the page requests - not the page loads -  a subtle but important difference.

 Signature 

“All men are equal. All men, that is, who possess umbrellas.” E.M. Forster 

Artscape and Santaballs
Chris O’Donoghue Chelsea Garden Designer
The Greenwich and District Narrow Gauge Railway Society
Croydon RFC

Profile
 
 
Posted: 13 May 2008 04:59 PM   [ Ignore ]   [ # 32 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  205
Joined  05-05-2008

What about the people like me? I don’t wait for a page to load because I already know where I want to go a click the link. So the page doesn’t “fully” load. GA has Conversion Goals where you can set up specific paths where you want the user to go to i,e index.php > contact.php > submit.php that way you track exactly where they go and that makes it a “conversion goal”. So technically I would be a visitor, yes a repeat but a visitor with a mission.

 Signature 

Invoked Projects


Panic Coda EE Clips

ideas are sparked by ramblings of confused personage

Profile
 
 
Posted: 13 May 2008 05:03 PM   [ Ignore ]   [ # 33 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  335
Joined  01-25-2006
WTHIGO? - 13 May 2008 04:59 PM

What about the people like me? I don’t wait for a page to load because I already know where I want to go a click the link. So the page doesn’t “fully” load. GA has Conversion Goals where you can set up specific paths where you want the user to go to i,e index.php > contact.php > submit.php that way you track exactly where they go and that makes it a “conversion goal”. So technically I would be a visitor, yes a repeat but a visitor with a mission.

Ok - this might seem a bit radical but set up two GA profiles - you have 10 in each account - one for the top of your page and one for the bottom. See what the difference is…

 Signature 

“All men are equal. All men, that is, who possess umbrellas.” E.M. Forster 

Artscape and Santaballs
Chris O’Donoghue Chelsea Garden Designer
The Greenwich and District Narrow Gauge Railway Society
Croydon RFC

Profile
 
 
Posted: 13 May 2008 05:22 PM   [ Ignore ]   [ # 34 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  598
Joined  11-07-2004

If you put your code in the footer you’re selling yourself short. All sorts of stuff can stop a visitor from showing up because anything in the site that delays the content loading is also delaying the loading of your footer, sometimes to the point it doesn’t get hit at all. Javascripts from other sites loading gadgets etc on your site will do this. in fact they’re notoriously the problem.

Id put your code as the first thing in the head of the page.

Also, GA is nowhere near accurate, and after a 90 day test i showed that it’s less accurate the busier the site is. I’ve got a site that gets over 2 million page views per day now. GA was horribly short on pageviews.

If you set up a log parser CORRECTLY you will get the only possible true stats. It’s not possible for any remote stats program to be accurate and they shouldn’t be used that way. They are great for tracking trends, and that’s how they should be viewed. There is no more accurate way to track stats than using your site logs. The problem is this isn’t always easy to get right. Using something like AWStats (which is free) works great, BUT you need to configure it to ignore false hits, ignore your hits and truly report JUST hits and pageviews.

 Signature 

Member: ExpressionEngine Pro Network: ePlaces Network Services

ePlaces Network Services

Profile
 
 
Posted: 13 May 2008 05:45 PM   [ Ignore ]   [ # 35 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  768
Joined  03-16-2002

The ideas I expressed above are based on a GA seminar. Of course: my fault not distinguishing between page requests and page loads.

A really accurate statistics is never possible due to a number of facts. Proxies might lead to miscounts for example, sometimes (especially on bad or busy connections), the request goes thru but the browser doesn’t receive all packets neccessary to render the page (blame the IP protocol, the ISP or whom soever), ... So, neither server logs nor GA or other monitoring/analytics services are able to deliver exact data.

But what is more important: The exact number of page requests/views isn’t business relevant at all. Its not the goal of a site to attract as much page impressions as possible at all cost (if it is yours, just add some free giveaways of cars made by some famous german car makers). That is where GA goals come into play - you can not only set goals (basically target URLs), but even add a (real or fictional) value to these goals. E.g. goals might be signups for a newsletter, requests for some additional information or a completed sale. And of course, the number of visitors not completing all steps to reach a goal is interesting - as are the URLs at which they leave the site. Of course, finding that data inside some server logs is very cumbersome - or needs some good tools.

All these tools - server-based or external like GA - only work with assumptions: When will a request from an IP be counted as a continuous visit, when is a session assumed to be ended, ... Your tool will never know if you read some text on the page for about 10 minutes or if you went to get some fresh coffee. Therefore, the pure statistics is just some smart marketing tool - but if you need information on where your site works and where not, you’ll need to digg deeper and the miscount of visits and page loads becomes irrelevant.

Okay - enough on this. Sorry for drifting away a bit.

Markus

Profile
 
 
Posted: 26 May 2008 10:54 AM   [ Ignore ]   [ # 36 ]  
Lab Assistant
RankRank
Total Posts:  124
Joined  04-02-2008

almost everyone in my office runs FF with the noScript addon.  The noScript addon blocks Google analytics, if your website is technical it may effect your analytics.  You never can tell what the crazy users are going to do.

 Signature 

Using EE since Apr08!

Come chat me up in IRC: #expressionEngine (irc.freenode.net)

My Version 1.6.3 & Build:  20080319

Profile
 
 
   
2 of 3
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64978 Total Logged-in Users: 30
Total Topics: 82017 Total Anonymous Users: 23
Total Replies: 440822 Total Guests: 188
Total Posts: 522839    
Members ( View Memberlist )