Analytics
2.3K members online now
Discuss regaining access to Analytics accounts, restoring accounts, changing user access levels, and navigating the homepage
 
Guide Me
star_border
Reply

Use Google Analytics API to get data

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

 

Im looking for a solution to get data from Google Analytics via an API to our db.

We are currently storing clientid with userid when user becomes a customer. We are interested in user behavior and would want to enrich our data with Google Analytics data. 

 

For Example looking to get User Explorer data, device, interest etc stored in our db. 

 

Q: What API should we use and is this possible at all? 

1 Expert replyverified_user

Use Google Analytics API to get data

Explorer ✭ ✭ ☆
# 2
Explorer ✭ ✭ ☆

Hi @Emile P,

I am assuming you are storing cliendID and userID in custom dimension in GA. You can then use GA Reporting API v4 to extract the dimension and metrics and merge with your data.
Check here : https://developers.google.com/analytics/devguides/reporting/core/v4/

Hope this helps,
Thanks,
Ritwik B

Use Google Analytics API to get data

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thanks for a quick reply. I can see that we currently only have the UserID in a custom dimension. If I can remember correctly the ClientID, is only used when we send hits via the measurement protocol for e-commerce. So we also need to create a custom dimension for clientID and we're all good? Smiley Happy 

Marked as Best Answer.
Solution
Accepted by topic author Emile P
March

Use Google Analytics API to get data

[ Edited ]
Explorer ✭ ✭ ☆
# 4
Explorer ✭ ✭ ☆

Hi @Emile P,

ClientId is always used by GA to identify unique users (browsers to be more specific). Here is a great article by Simo for tracking ClientId and more.

ClientID is by default available in user explorer report in GA, but to fetch it through API, you'll have to add it to custom dimension.
If you need any additional metrics, do check for the available dimensions and metrics in the API here:
https://developers.google.com/analytics/devguides/reporting/core/dimsmets

Thanks,
Ritwik B

Use Google Analytics API to get data

Rising Star
# 5
Rising Star

Google Analytics Reporting API v4 https://developers.google.com/analytics/devguides/reporting/core/v4/

_________________________________________________________________________
Director of Marketing | Nehmedia | Partner Profile