Forum Moderators: DixonJones

Message Too Old, No Replies

Google Analytics

Every page - or selected pages?

         

D_Blackwell

10:30 pm on Aug 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have added Google Analytics to the key content pages, and the secondary content pages, of a website. These are the pages that I am most interested in, and the script is inserted just before before </body> as instructed.

However, right before </body>, on every page of this site, is an include with a copyright notice.

1) Better to leave it the way I started?

2) Better to strip out the individual insertions, and just plug it in at the end of the include? The majority of the pages on the site are of tertiary importance at best, but...

3) Or something I haven't thought of?

g1smd

11:02 am on Aug 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I put the analytics code into an include, just in case I ever need to change the code in some way at a later date. There is just one file to edit at that time.

The include file also has some dynamic features, in that all staff have a cookie so that they don't get tracked. The script checks for that cookie and disables tracking if found. The tracking is also turned off if the include file detects that it is being served from the test folder of the live site or from the development server.

In the GA profiles, I have one that tracks only page views on the domain (using an "include" filter) and I have another profile that tracks all page views that are off the domain (using an "exclude" filter). The latter profile shows page views in the Google, Yahoo, and Live Search cache, and on any other sites that have copied the content.

cgrantski

11:10 am on Aug 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It makes sense to do it the way you did, if that's all you want to know. Aside from records on the tertiary pages, you will lose the sources of the traffic, i.e. whether they clicked on a link on another site, found you through search, what search terms they used, which page they entered your site on, how many people never got to your key pages, and so on. If it's okay with you to not have that information, you're okay.

Personally, I would go back and use the include method just on principle (because more data is better) unless your key pages would end up so far down the list of results that something might fall off the end or not be included in the internal tables. You'd have to have a LOT of tertiary pages however.

g1smd

11:15 am on Aug 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you don't want it to appear on every page, you can still add the code to an include and have a few lines of logic deciding whether to show the code or not. That way you can make changes to what is tracked simply by editing that logic, not by having to cut and paste code into hundreds or thousands of pages.