community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
New Data Science Blog

Check out the latest post: All Models Are Wrong

READ MORE
Announcement | We'll be doing maintenance between pm 4- 6pm MT, which may impact your experience. Thanks for your patience as we work on improving the community!

Google Analytics tool and data sampling

Highlighted
Alteryx Partner

Hi.

 

My customer wants to analyze data from Google Analytics.

However, the data is too big and it keeps on getting sampled, which is a problem since we want actual numbers of sessions and page views.

 

I learned that when you choose "TRUE" for Use Resource Quotas on the Google Analytics, your data won't get sampled.

My question is, can you set the GA tool in Alteryx in the same manner?

I'm having trouble finding such category in configuration window.

 

Attached are...

-what it looks on the Google Analytics Configuration Options (what I want to achieve)

ga_configuration.PNG

-what my current tool configuration window looks like

GA_tool_configuration.png

 

thanks in advance!

Comet

Hi hhimeno,

 

I'm not sure about modifying the resource quotas to "TRUE", but one workaround I figured out was wrapping the Google Analytics tool up as a macro and running smaller sets of dates through it. So rather than using the past 30 days all at once, run it one week at a time. All you need to do is to have two control parameters in the macro - one that updates the startDatePicker value and one that updates the endDatePicker value.

 

This should help you with your problem but I'm definitely interested to know if anyone else has another solution!

Comet

I used this method recently for a smaller site that didn't have the sampling issues on the monthly level, but the concept is still the same. It was also helpful because I was able to pull more metrics than you can currently select in the tool and join them on their respective dimensions - date and landing page path or date, channel grouping, and campaign. . 

 

 

macro pic one.PNGmacro pic two.PNG

Alteryx Partner

 

 

Comet

Wow sampling even at the daily level? Crazy! Well you could apply this method down to the day level and at least have less sampling. Sorry I can't be more helpful. 

Atom

Do you have a working example of this macro/

Comet

Hi jawein,

 

I had to strip out my Google Analytics credentials in order to share it here, but you can enter your offline credentials in the supporting macro to apply to your own use case. This one pulls daily Google Analytics data one month at a time. You could modify this workflow to feed in a week start and week end instead if you are still running into sampling issues. 

 

 

Main workflow:

 

iterative 1.PNG

 

 

Macro opened up:

iterative 2.PNG

 

Supporting Macro within macro opened up (Blue circle to the right of the first formula in previous picture):

 

iterative 3.PNG

Atom

Hi,

 

Thanks for sharing this workflow - I've got a GA sampling issue which I think I'm now very close to cracking.

 

My last hurdle (I hope) is an error message I'm getting:

 

"Google Analytics API Error Message: Invalid value ''. Values must match the following regular expression: '[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)'"

 

I'm using an excel file to feed in my dates, and have tried using a formula tool to break it down to component parts and build it back up but still no joy. Any ideas what I'm doing wrong?

 

 

Comet

Hey DanJG,

 

Is this an error you are getting from a formula tool?

 

If you are feeding in your dates from an Excel file, use a select tool to check to see if they are coming in as V_WString or Date. If they are coming in as V_WString, you can use the DateTime tool under the "Parse" tab up top to get them converted to date format.

Atom

I was able to get this to work so it pulls one day at a time, which is what I needed to avoid sampling.   If anyone is interested, I can explain how I did it.

Labels