Go Back   CodingForums.com > :: Client side development > General web building

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-29-2010, 10:28 AM   PM User | #1
gh05
Regular Coder

 
Join Date: Aug 2008
Posts: 133
Thanks: 14
Thanked 0 Times in 0 Posts
gh05 is an unknown quantity at this point
Adding Google Analytics to a non static web pages?

I want to find out what is being most frequently searched in a database. Google Analytics has been suggested for this. I know analytics is easy to setup for static pages but not sure when the data will be changing for the same web page.

I've found this from the Analtyics site (http://www.google.co.uk/support/goog...k&answer=55504)

but it mentions adding the tracking code to the php pages but I don't see how this would work as different information is pulled back depending on what the user selects from the database.

Can anyone advise please?

Last edited by gh05; 01-29-2010 at 10:45 AM..
gh05 is offline   Reply With Quote
Old 01-29-2010, 05:36 PM   PM User | #2
byuhobbes85
Regular Coder

 
byuhobbes85's Avatar
 
Join Date: Oct 2006
Location: Ames, Iowa, USA
Posts: 116
Thanks: 9
Thanked 4 Times in 4 Posts
byuhobbes85 is an unknown quantity at this point
Adding Google analytics to a dynamic page is the same as adding it to a static page. However, it does not index page contents and so I don't think it will give you the information you're looking for.

As a first step, are you capturing the search terms people enter on your site?. You could start there (send search terms to a database when search field is submitted) and then come up with ways of grouping search terms later (if necessary).
__________________
-- </byuhobbes>
byuhobbes85 is offline   Reply With Quote
Old 01-29-2010, 09:31 PM   PM User | #3
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,044
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
I think because PHP renders the code (and content) BEFORE it is sent
to the browser, the Google Adsense Javascripting would see the content
just as though it were static. I see no reason why it wouldn't work.
mlseim is online now   Reply With Quote
Old 01-30-2010, 01:27 PM   PM User | #4
byuhobbes85
Regular Coder

 
byuhobbes85's Avatar
 
Join Date: Oct 2006
Location: Ames, Iowa, USA
Posts: 116
Thanks: 9
Thanked 4 Times in 4 Posts
byuhobbes85 is an unknown quantity at this point
Yes, server side scripts (PHP, .NET, whatever else) do transform data into HTML before returning it to the client. My question is whether Google Analytics indexes the entire page contents every time the pages loads. I doubt it, and therefore I doubt it can be used to track what he's looking for.

Then again...

Google Analytics does track URLs. Let's say when a user submits a search form, the target page puts the search term in the URL--something like this.
Code:
http://yoursite.com/search.php?q=users+search+terms
I know that Google Analytics will keep track of the number of visits these pages. What I don't know is what they do with URL parameters (i.e., everything after the ? in the URL). If it strips those, then this approach is useless, but if it keeps those it may accomplish what you're looking for.
__________________
-- </byuhobbes>
byuhobbes85 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 08:44 PM.


Advertisement
Log in to turn off these ads.