sammarcow
sammarcow

Reputation: 2956

google analytics API custom variable

I have a google analytics account for an asp.net application which determines one of many clients based on a queryString within the URL. The snippet for the GA page is located within the master page, so the GA code is consistent across all clients.

What is the most efficient process for getting a set of basic analytics through the GA portal, per client (per queryString)?

---Edit---

Off hand , but never accomplished, I want to know if I can set a variable var1 within the snippet that gets set to GA identifying a client, then get discrete but identical reports, per var1 on the users. So that var[0] .. var[n-1] = Visitors where n is the number of clients.

Upvotes: 0

Views: 388

Answers (2)

vly
vly

Reputation: 316

You can just push the unique query string (assuming it's some sort of uID) as a custom variable into analytics. If it's sequential, you can assign ranges to clients (once again, am just guessing what your setup is like).

Alternatively, you can use the uID as key and have visit frequency as the value. (here is some prototyping code to check custom var key values https://github.com/vly/js_ga_cvars)

Just remember, when you set the custom vars you have to push a pageview or event to actually pass it to GA.

If you have access to the GA Universal beta program, you have the opportunity to define custom metrics (in case of a numeric data) or dimensions which would make aggregation reporting a lot easier.

Upvotes: 1

Pleun
Pleun

Reputation: 8920

If the client is an individual person, this is not allowed by the google terms of service.

You will not (and will not allow any third party to) use the Service to track, collect or upload any data that personally identifies an individual

http://www.google.com/analytics/terms/us.html

Upvotes: 0

Related Questions