Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7653609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:04:13+00:00 2026-05-31T12:04:13+00:00

I’m building a site that allows users to create a profile. Each profile page

  • 0

I’m building a site that allows users to create a profile. Each profile page is identified in the query string by a unique 12-digit code. (http://www.site.com/users/user_detail.php?id=0021-4432-5554). I expect the number of profiles to eventually be 30-50k. I would like to provide each user with a profile to view analytics of their profile (page views, time on page, and click events on their page). Initially I built a custom solution using jquery and an external PHP file to insert records into a database table for each tracking event. This works well but I’m worried about scalability and thought GA might be able to do a better job. I’ve been digging around the GA documentation all day, but I’m still a bit unclear on the best way to implement this. My current approach is as follows:
1) Insert GA tracking code in the profile page with event code for each click event I want to track.
2) Use GAPI with the following code to display page views to users.

https://www.google.com/analytics/feeds/data?ids=ga%xxxxxxxxxx&dimensions=ga%3ApagePath&metrics=ga%3AuniquePageviews&filters=ga%3ApagePath%3D%3D%2Fusers%2Fuser_detail.php%3Fcode%3D0021-4432-5554&start-date=2012-02-29&end-date=2012-03-14&max-results=50

I am unsure of the following:
1) Is this the best way to retrieve pageviews for a page identified by a querystring parameter? (matching the entire url vs just matching the 12-digit code with a regular expression)
2) Is it possible to retrieve and display events such as clicks on the page using GAPI? I recall reading somewhere that the API couldn’t be used for events.

I think I’m heading in the right direction, but would really appreciate some guidance here. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:04:14+00:00Added an answer on May 31, 2026 at 12:04 pm

    Honestly implementing custom stats would be much better for a few different reasons. First of all 1 database insertion for every page view on the profiles is somewhat accaptable for small numbers. If the page starts creating a bottleneck then you could have an a sync request when the page loads.

    What you could do is have one table for the stats.
    Id
    URI
    Click/action
    User profile
    Date

    Then its easy to grab the amount of clicks and views.

    If you go with Google you won’t have as much freedom on what you can do with that data. 30k isnt a lot of rows and once you hit probably in the tens of millions of records you could start worrying about scalability.

    But anywhere below that you should be fine.

    EDIT:

    I might add that google analytics does have a good api when working with analytics but you do limit your control on the data. Never the less for a long term approach and a statistics database can get extremely large extremely fast. Hitting the ten million mark with 30K users won’t be too difficult. So if scalability is your main concern then maybe you would want analytics to handle it.

    First you must register your application to use the api tools that google gives you:
    https://code.google.com/apis/console

    But one issue is that the analytics api puts a courtesy limit on the number of daily requests at 50,000 queries/day. Though if you need more you may use this link to ask for more: https://docs.google.com/spreadsheet/viewform?hl=en_US&formkey=dGp3NEc0Z0dsX293V1UyckZtdDlGQmc6MA&ndplr=1

    Is it possible to retrieve and display events such as clicks on the page using GAPI? I recall reading somewhere that the API couldn’t be used for events.

    Yes it is very much possible. Here is the Events API page: http://code.google.com/apis/analytics/docs/gdata/dimsmets/eventtracking.html

    Another nice tool is available here: http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html

    If you need more API references here they are: http://code.google.com/apis/analytics/docs/gdata/v3/gdataGettingStarted.html

    Google provides many different apis for handling page views, events, reports. They also support many different languages for their libraries as mentioned above. You will be able to register an event(such as a click) and page views for a particular page(users profile). You will also be able to request all the statistics back onto your site for graphing or other needs.

    Lastly, here is the api libraries toolkit for any particular language: http://code.google.com/apis/analytics/docs/gdata/v3/gdataLibraries.html

    Hope this helps,
    Daniel

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.