BookmarkSubscribeRSS Feed
HenriTheuwissen
Calcite | Level 5

Hi,

 

We need to exploit Google Analytics data. We found several documents and blogs, but they're all quite 'old'. The SAS Support team indicated that a lot changed in the meantime and that these articles are outdated. They suggest to work with PYTHON.

Does anybody have some examples of this?

Note: the solution should run on Linux 9.3. 'Plan B'  is to run it on Windows.  

 

Regards,

 

Henri

3 REPLIES 3
Rick_SAS
SAS Super FREQ

You did not mention what SAS tools/products you have.  Most modern presentations that I have seen on this topic use a tool such as SAS Visual Analytics.

HenriTheuwissen
Calcite | Level 5

Hi Rick, 

 

We do not have Visual Analytics

We do have the 'traditional' SAS/EIP platform (with SAS/DI, IMap, Web Report Studio, OLAP Cubes etc.)  

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.  This does require SAS 9.4m4.

 

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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 635 views
  • 0 likes
  • 3 in conversation