Google Analytics Report Automation (Magic Script)

Preview:

Citation preview

Google Analytics Magic ScriptCreated By: Keshav Kashyap

Agenda:-

What is Google Analytics?Why Google Analytics?How to use GA in ApplicationKey Features of GAAdvantages and DisadvantagesHow to setupMetrics and DimensionsAutomation of GASample Report & Demo

What is Google Analytics?Free Service Offered by Google for Website

Statistics.Daily, monthly, yearly tracking of web visits

Graphed over timeWhich pages they go to, how long they stay

Bounce rateEntrance pages

How they got thereSearch engines and Search terms used

Location, operating system, monitor resolution

How it works ? Sign up for Google Analytics

https://www.google.com/analytics/

They return code to you You paste the code just below the </body> tag Put it on EVERY page

Edit>Find and Replace is easiest option

Put it in your template pages, so it will be automatically on every page

Go to the Analytics dashboard page to see daily metrics

What it does?Daily, monthly, yearly tracking of web visits

Graphed over timeWhich pages they go to, how long they stay

Bounce rateEntrance pages

How they got thereSearch engines and Search terms used

Location, operating system, monitor resolution

Key Features of Google Analytics:- It helps in Website Trafficking.

Where the visitors came from?How they are navigating through site?

ConversionDownloadsPage ViewsRegistration

E-CommerceAd-Words Performance

Advantages :-

Free Sufficiant possibilities for most companies Easy to implement Easy to use Easy to understand

Dis-advantages :-

URL and title based No data history Privacy ? JavaScript and cookies Only visitors, no crawlers or bots

What is Google Analytics Report Automation?

Google Analytics Report Automation (Magic) is an integration that reduces the work required to put Google Analytics data into any Apps Script supported product, such as Google Docs, Sites, or Spreadsheets.

How Google Analytics Report Automation Works?

Create a Dashboard on Google Spreadsheet. Add Google Analytics Report Automation (Magic

Script) Turn on access to the APIs for your first time.

Looking at the tabs on top, Script Editor > Resources > Use Google APIs > Make sure Google Analytics API is on.

Script Editor > Resources > Use Google APIs > Click “Google APIs Console” > Turn Analytics API On > Agree to Terms.

How Google Analytics Report Automation Works?

Go to the “gaconfig” sheet and enter the profile number for a view you have access to. You can find the profile number either by: Going to the Google Analytics tab and choosing “Find profile / ids”

Bringing up a report in the Google Analytics interface in that specific view.

Go to “Dashboard” sheet and run “Get Data” from the Google Analytics tab.

Required Inputs or Query Parameter Details:-Account ID :- the (Magic) script comes with a ‘Find Profile/IDs’ option underneath the Google Analytics menu. ids =ga:12345Start Date/End Date (*required) : today()Metrics (*required) : ga:session,ga:bouncesDimension : ga:browser,ga:citySort : ga:countryFilter : ga:mediumMax Result :100Start and End Index : 10 to 100Output : Name of the Sheet

Some Sample Metrics and Dimensions :-

Dimensions Metricsga:hostnamega:pagePathga:pagePathLevel1ga:pagePathLevel2ga:pagePathLevel3ga:pagePathLevel4ga:pageTitlega:landingPagePathga:secondPagePathga:exitPagePathga:previousPagePathga:pageDepth

ga:pageValuega:entrancesga:entranceRatega:pageviewsga:pageviewsPerSessionga:uniquePageviewsga:timeOnPagega:avgTimeOnPagega:exitsga:exitRate

Sample Query Parameter :-query1 value1type coreids ga:80332348start-date 2/10/2014end-date 2/19/2014last-n-days metrics ga:visitsdimensions ga:datesort filters segment start-index max-results sheet-name App Sony PlayStation

Trigger your Script:-

Go to Add-ons. Select Google Analytics. Navigate to Schedule Reports.

Sample Report:-

Results for query query9 Date executed 5/4/2015 5:59:27 Profile Name WWE.comTotal Results Found 1 Total Results Returned 1 Contains Sampled Data FALSE Totals For All Results ga:visits ga:visitors

1480 1353 ga:visits ga:visitors

1480 1353