BookmarkSubscribeRSS Feed
kaushalsolanki
Quartz | Level 8

Hello All,

 

Can any one guide me how to fetch Google Analytics Data through SAS Programing,

thanks in advance.

 

Regards,

Kaushal Solanki

2 REPLIES 2
SteveM_UK
Obsidian | Level 7

Hi Kaushai,

 

Try this paper from SAS Global Forum http://support.sas.com/resources/papers/proceedings10/049-2010.pdf

and there's also this blog article http://www.sasanalysis.com/2011/11/when-google-analytics-meets-sas.html

 

I haven't tried any if this myself but the two authors cover the topic well

 

The only thing I'll add: these articles are from 2010/2011 so things may have changed and there might be new methods you could use.

 

Regards

 Steve

ChrisHemedinger
Community Manager

Coming back to this because now with PROC HTTP and the JSON libname engine, it's possible to fetch Google Analytics data via Base SAS code.

 

High level steps:

  1. Grant permission and obtain an authorization token for your "app" (a SAS program, in our case). This must be performed in a browser while logged into your Google account.
  2. Obtain an access token and refresh token. You can accomplish this with a SAS program that you run just once. You then save the refresh token (in a safe place!) for subsequent runs.
  3. Convert your saved refresh token into an access token. Do this at the start of every SAS job that needs to get Google Analytics data.
  4. And finally, use the Google Analytics API to get actual data!

Details are in this blog post.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 485 views
  • 0 likes
  • 3 in conversation