Use Google Analytics for individual users - google-analytics

I have a website where people post items and I want to show some basic analytics in their own user panels, such as how many people viewed the posted item.
I am wondering if I can use a single mothership Google Analytics account across the whole site. Then, in my code for the user area, I have it query Google Analytics for that specific users posts and return the number of visits that specific person has had.
So my google analytics account may say "200 views across the whole site" but within the specific users panel I will be able to say "Your posts received 50 views".
This is the closest bit of documentation I could find on the subject:
https://developers.google.com/analytics/devguides/reporting/core/v3/

It sounds like what you would need is multiple Google Analytics IDs / requests per page. This can be done with the newest version of Analytics, though not with the Classic Analytics.
You can certainly have multiple Google accounts access the single Google Analytics for a single domain. You can certainly split reporting capabilities and access to various Analytics features across multiple accounts.
From the docs:
You can install multiple instances of the Google Analytics tracking
code on your web pages to send data to multiple properties in your
account.
Read: more here.

Related

Can't get proprely amount of Users in API

When i use personal reports in Google Analytics i see different numbers of users in the report than when i get them with API.
Support of GA answered, that this is ok, because system use different ways to count users in report when i use GA and in data which i got from API.
Is there any way to get same number of users by API, which i can see on site of GA in my personal report? Because now, when i try to get users with API for same period and with same dimensions i get different number of users, than i can see in personal report on GA site.

Google Analytics for website users

I operate a high-traffic website, where users have a public page (e.g. website.com/users/$USERNAME ) and would like to create analytics for them. Instead of re-inventing the wheel, the best would be if I could leverage google analytics directly.
It's not a problem is users opt-in to this scheme, and give me their google account name. One idea was to create custom analytics views for users, but it seems there's a limit of 25 views per properties.
Another thing I was looking at, is using Google Analytics segments, but it seems that segments are scoped to a subset of users or sessions, while I want it on certain page-hits only.
I could also dynamically use their google analytics code, if it was scoped to a single page.
Is this use-case something that Google analytics supports, or should I develop a home rolled solution?

How to share a part of the site in Google Analytics

we have events listing website and events from different organizers are grouped (by URL), like -
www.site.com/organizer/event1
www.site.com/organizer/event2
www.site.com/organizer/event3
etc. How to give an organizer an access only to his/her part of the site's Google Analytics?
Easy way -
An organizer registers in Google Analytics
An organizer creates a counter in Google Analytics
An organizer sets this counter in his/her profile on our website.
We add this counter to our Google Analytics code on www.site.com/organizer/* pages
He/she clicks on some link in the profile and sees the GA stat only for own events.
The way I want it:
He/she clicks on some link in the profile and sees the GA stat only for own events.
Is this possible with some API to separate statistics for www.site.com/organizer/* and share a private link to it with organizer?
After reading your comments in another answer (which is basically just a copy of the comment I left on your question). I have changed my recommendation left in comment, think you should use the Google Analytics API for this.
Since you want to give others access to your own data I suggest you use a service account. You will need to do this in a server sided programing language, say PHP or C#.
Every night run a job that will extract the data you want though the Core reporting API. Store it in the database then create a page that will then display only the data you want to the different people. You will only need to run your job once per day as the data for previous days will never change. Wait at least 24 hours to get the data as data hasn't completed processing for 24 hours.
I am not sure what language plan on using but these tutorials should get you started: Google Service Account with PHP or Google Analytics API Authentication with C#
I would create different profile views with filters to include only the subset of data for the subpages.
This way, you can add a specific user access rights to that specific profile only, so they can only view that profile when they log in.
Create an include only filter which filters on Request URI: /organizer/event1, /organizer/event2, /organizer/event3 etc.

Show Google Analytics Data to Users

I am building a website and every user will upload images. The users' images will have unique IDs. The users will have their own dashboard with analytics.
I want to provide every user with analytics data (unique visitors, page views, bounce rate, etc.) for their own information. I am thinking of using google analytics for this instead of building something on my own.
Can this be done through google analytics legally? Are there any restrictions on showing such analytics information directly to the user?
The legal restriction with the Google TOS is that Google must not have any way to connect collected data to an existing person ( "data which can be reasonably linked to such information by Google", TOS ยง7). You are allowed to store anonymous IDs that can be matched in your own backend to persons as long as they cannot be resolved to individual users by Google.

Separate analytics for each profile page within a single website

There are multiple profiles on my website and each user is managing his/her profile himself. I am trying to find the most efficient way to present analytics of each profile to its owner. Here are 3 ways I found:
Record each and every hit made on a profile page against that profile. This is not just count of hits, this requires to record IP, country, referrer, search terms etc. against each hit. This would require me to manage a huge database as there would be a lot of hits on each page. And a lots of processing on this database. Even if I have to de this, what database is recommended for such use?
Use Google Analytics on each page. But I am not sure that Google Analytics provide an API to fetch Analytics for individual pages.
Use some open source solution like piwik. Again I'm not sure if they provide per page analytics or not.
Please suggest the pros and cons of using each approach.
Update: More explanation - Think of it like a facebook page where each user can see hits on his page. What solution you'd suggest?
For Piwik, you can create a site id for each user, because you are allowed unlimited site ids with Piwik. You can can use a tracker with that user siteid, so when your member logs in, they get data only on their pages. You might also want to look at using custom variables and use the Piwik API to filter data.
Check here for info on multi-tracker: http://piwik.org/docs/javascript-tracking/#toc-multiple-piwik-trackers

Resources