Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Aug 2008
    Posts
    133
    Thanks
    14
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Regular Coder byuhobbes85's Avatar
    Join Date
    Oct 2006
    Location
    Ames, Iowa, USA
    Posts
    116
    Thanks
    9
    Thanked 4 Times in 4 Posts
    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>

  • #3
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,464
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    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.

  • #4
    Regular Coder byuhobbes85's Avatar
    Join Date
    Oct 2006
    Location
    Ames, Iowa, USA
    Posts
    116
    Thanks
    9
    Thanked 4 Times in 4 Posts
    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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •