Possible to Track Organic Visits to Specific URLs via Excel VBA/Google API?

547 views
Skip to first unread message

Dan Kern

unread,
Apr 30, 2013, 10:35:14 AM4/30/13
to google-analytics...@googlegroups.com
Hi Everyone, our company tracks Google Analytics stats for hundreds of websites into an Excel Spreadsheet using the VBA formulas connecting to the Google Analytics API. We're familiar with the basics like tracking visits, unique visitors, organic visits, referral visits, etc.

We need a separate report to track a few hundred specific URLs, individually, but in one spreadsheet. So, we want to have each URL on it's own row, and have columns for each month...and track organic monthly search visitors for each page. This will allow us to see how each page is trending month to month, quarter to quarter, year to year, etc.

Can anyone offer any advice on the formulas we'd need to use to accomplish this?

Thanks so much!
Dan

chris@shufflepoint

unread,
Apr 30, 2013, 11:13:49 AM4/30/13
to google-analytics...@googlegroups.com
Are the URLs for different GA account and web properties, or for a single web property?

Dan Kern

unread,
Apr 30, 2013, 11:20:52 AM4/30/13
to google-analytics...@googlegroups.com
We have @ 5-50 different URLs to track across @ 25 websites (each)...so, several hundred URLs total. I figured if there's a way to do this, we could have different worksheets in one spreadsheet for each website...and use the profile ID to tell the Google Analytics API which site each URL is for. If we need to use separate spreadsheets, then we'll do that...but not ideal.


--
You received this message because you are subscribed to a topic in the Google Groups "Google Analytics Reporting API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-analytics-data-export-api/A0qCmuD5NfM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-analytics-data-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Dan Kern

chris@shufflepoint

unread,
May 1, 2013, 11:08:14 AM5/1/13
to google-analytics...@googlegroups.com
Hi Dan,
Are the specific URLs completely arbitrary? Or can they be identified using an advanced segment? How many URLs total on these sites?  If less than ~1000 then I would query the whole website and then in Excel do vlookups to get the information for the ones that you've identified.
To unsubscribe from this group and all its topics, send an email to google-analytics-data-export-api+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dan Kern

unread,
May 1, 2013, 11:15:48 AM5/1/13
to google-analytics...@googlegroups.com
Chris, thank you for your reply. Much appreciated. Here's a specific example. In March of last year, we had 153,000 organic search visits to one our websites that we need this report for. 6,580 different URLs drove those visits. We have maybe 40-50 different URLs that we need to track monthly organic search traffic for. Using an Advanced Segment would defeat the purpose since we'd have to lump them all together. We want to track them all individually and then use an Excel formula (in the spreadsheet) to tally up the results. How does this affect your suggestion?


To unsubscribe from this group and all its topics, send an email to google-analytics-data-...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

chris@shufflepoint

unread,
May 1, 2013, 11:25:46 AM5/1/13
to google-analytics...@googlegroups.com
The advanced segment would act as a filter. It would identify the subset but not lump them together. For example if the ones you were interested all had some character sequence - or even one of several such sequences, then you could create an advanced segment to select those pages.  You could also do it with a dynamic segment in the API.  Or, like I said, select all pages and then filter in Excel. How many pages/URLs?

I didn't understand your statement "6,580 different URLs drove those visits". 

Dan Kern

unread,
May 1, 2013, 11:54:46 AM5/1/13
to google-analytics...@googlegroups.com
Hi Chris, there is no unique character set in the URLs. They are just root level. I understand what you were getting at, though.

6,580 different URLs drove 153,000 visits last March indicates that if we were to pull all of the URLs into Excel that drove organic visits, that would be 6,580...which is many more than 1,000.

I would think there has to be a way to query the Google API for a specific URL just like how you can query the API to pull organic search visits, or keywords, right?


To unsubscribe from this group and all its topics, send an email to google-analytics-data-...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

chris@shufflepoint

unread,
May 1, 2013, 12:21:48 PM5/1/13
to google-analytics...@googlegroups.com
For any specific web site there are probably <1000 URLs, so I'd still be inclined to get all the pages (ga:pagePath) and then filter in excel using VLOOKUP or equivalent.

Dan Kern

unread,
May 1, 2013, 1:07:39 PM5/1/13
to google-analytics...@googlegroups.com
Most websites have less than 1,000 URLs, but not ours. Here is a screenshot showing that we have 6,580 different landing pages that drove traffic in March of 2012. Much more than 1,000: http://screencast.com/t/k8u6yxMMU4e 

Is it possible to further define (ga:pagePath) to additionally query specific URLs? I'm afraid that pulling nearly 7,000 URLs in order to sculpt it down to 40-50 URLs is going to 1) make the report too slow, and 2) provide too much extra work in refining the list of URLs to the 40-50 that we need.

Thanks again for your brainstorming efforts. Much appreciated.


To unsubscribe from this group and all its topics, send an email to google-analytics-data-...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

chris@shufflepoint

unread,
May 1, 2013, 2:09:30 PM5/1/13
to google-analytics...@googlegroups.com
Hi Dan,
Ok. I was assuming that the 6580 was split across ~25 sites, which would mean an average of ~300 per site.
But responding to your concerns, I think getting all and filtering will be faster, and in any solution you will have the work of refining the list to the 50 of interest. GA allows you to get up to 10,000 records in a single call.

Dan Kern

unread,
May 1, 2013, 2:22:39 PM5/1/13
to google-analytics...@googlegroups.com
Okay that is a good option then, thank you. I still would prefer to see if there's a way to run a Google API Query via Excel VBA formulas for a specific URL. Hopefully someone can chime in with a solution, otherwise we can pull all and refine from there per your suggestion. Thanks again :)


To unsubscribe from this group and all its topics, send an email to google-analytics-data-...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

chris@shufflepoint

unread,
May 1, 2013, 2:37:04 PM5/1/13
to google-analytics...@googlegroups.com
You can certainly retrieve the metrics for individual URLs using a ga:pagePath filter. But I think it would slower since you'd need to make a few hundred calls to the GA API.

Dan Kern

unread,
May 1, 2013, 3:02:15 PM5/1/13
to google-analytics...@googlegroups.com
So would the formula/code be like this?

ga:/specific-page-url-here


To unsubscribe from this group and all its topics, send an email to google-analytics-data-...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

chris@shufflepoint

unread,
May 1, 2013, 3:07:41 PM5/1/13
to google-analytics...@googlegroups.com

MT

unread,
May 6, 2013, 4:17:08 AM5/6/13
to google-analytics...@googlegroups.com
You can use my VBA functions for this: http://www.automateanalytics.com/p/google-analytics-vba-functions.html

To get data for a specific URL, type "pagepath==x" as the filter parameter, where x is the URL. As Chris suggested, the other option is to fetch data for all URLs and do the filtering in Excel; for this, type "pagepath" as the dimension parameter.

Shivam Gupta

unread,
Dec 10, 2013, 2:24:32 AM12/10/13
to google-analytics...@googlegroups.com
Hi Dan,


Can you please let me know how can we use VBA to extract data (unique visitors, daily pages vies etc) from Google Analytics.

Any help would be really appreciable.

Regards
Shivam
Reply all
Reply to author
Forward
0 new messages