This document provides an overview of Google Analytics and how to automate Google Analytics reporting using a Google Apps Script. It discusses what Google Analytics is, how to set it up, key features and metrics, and demonstrates how to automate report generation by connecting a Google Sheet to Google Analytics data using parameters like dimensions, metrics, dates, and profile IDs. Sample code is provided to pull Analytics data into a sheet on a scheduled basis to create automated reports.
2. Agenda:-
What is Google Analytics?
Why Google Analytics?
How to use GA in Application
Key Features of GA
Advantages and Disadvantages
How to setup
Metrics and Dimensions
Automation of GA
Sample Report & Demo
3. What is Google Analytics?
Free Service Offered by Google for Website
Statistics.
Daily, monthly, yearly tracking of web visits
Graphed over time
Which pages they go to, how long they stay
Bounce rate
Entrance pages
How they got there
Search engines and Search terms used
Location, operating system, monitor resolution
4. 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
5. What it does?
Daily, monthly, yearly tracking of web visits
Graphed over time
Which pages they go to, how long they stay
Bounce rate
Entrance pages
How they got there
Search engines and Search terms used
Location, operating system, monitor resolution
6. Key Features of Google Analytics:-
It helps in Website Trafficking.
Where the visitors came from?
How they are navigating through site?
Conversion
Downloads
Page Views
Registration
E-Commerce
Ad-Words Performance
7. Advantages :-
Free
Sufficiant possibilities for most companies
Easy to implement
Easy to use
Easy to understand
8. Dis-advantages :-
URL and title based
No data history
Privacy ?
JavaScript and cookies
Only visitors, no crawlers or bots
9. 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.
10. 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.
11. 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.
12. 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:12345
Start Date/End Date (*required) : today()
Metrics (*required) : ga:session,ga:bounces
Dimension : ga:browser,ga:city
Sort : ga:country
Filter : ga:medium
Max Result :100
Start and End Index : 10 to 100
Output : Name of the Sheet
14. Sample Query Parameter :-
query1 value1
type core
ids ga:80332348
start-date 2/10/2014
end-date 2/19/2014
last-n-days
metrics ga:visits
dimensions ga:date
sort
filters
segment
start-index
max-results
sheet-name App Sony PlayStation
15. Trigger your Script:-
Go to Add-ons.
Select Google Analytics.
Navigate to Schedule Reports.
16. Sample Report:-
Results for query query9
Date executed 5/4/2015 5:59:27
Profile Name WWE.com
Total 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