SlideShare a Scribd company logo
1 of 22
Introduction to Google Analytics 
for web developers 
Rubén Martínez
Google Analytics reports incoming traffic to webs 
and apps 
This graph compares the count of visitors from Google organic search to a website in two 
periods of time. 
The story it is telling us is good news: the organic traffic markedly increased in a given 
month over the same period of the previous year (due to a previous investment in content 
and SEO). 
Introduction to Google Analytics -@RubenMartinezS
Google Analytics helps understand your visitors’ 
flows 
Traffic volume by 
channel e.g. 
sessions per 
campaign and 
geolocation 
Engagement 
• Depth 
• Density 
• Duplication 
Content 
• A/B testing 
• Path Analysis 
Introduction to Google Analytics -@RubenMartinezS
Google Analytics is: 
• A platform to track online and off-line activity of aggregated and anonymized 
visitors’ data 
• A behavioural reporting platform of activity of web visitors and end-users 
• A bread-and-butter tool for webmasters and marketing and business analysts 
• A (peculiar) dashboard interface and a well documented API 
Introduction to Google Analytics -@RubenMartinezS
2 Web Analytics platforms: GA and SiteCatalyst 
Introduction to Google Analytics -@RubenMartinezS 
Number of websites using Google 
Universal Analytics (left) vs. 
Omniture SiteCatalyst (below). 
Graphs with the same vertical 
scale and similar periods of time. 
Source: builtwith.com
Organization of the platform 
Developers can access Google Analytics via a front interface, client libraries and 
APIs. This is how each components and APIs are organized: 
Source: https://developers.google.com/analytics/devguides/platform/ 
Introduction to Google Analytics -@RubenMartinezS
Google Analytics is NOT: 
• A transactional CRM tool 
Visitors’ individual data is owned by Google Inc. 
The end user has access to anonymized data only. 
• A reporting tool of websites only 
It can be configured to track offline and online 
activity from multiple devices, including 
smartphones, kiosks, consoles, etc. 
• A parser of web server logs 
• A KPI-centric Business Intelligence platform 
Introduction to Google Analytics -@RubenMartinezS
Tracking code 
Sign up to Google Analytics. If are tracking a website on the admin panel, setup 
a property (URL). Then paste the code provided by Google (example below) on 
all the pages you want to track: 
<script> 
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 
ga('create', 'UA-2282690-1', 'paradigmatecnologico.com'); 
ga('send', 'pageview'); 
</script> 
When the browser loads this script, it interprets the document.write and triggers 
a sequence of events leading to send hits to Google’s server. 
Introduction to Google Analytics -@RubenMartinezS
Browsers sends hits to Google Analytics server 
Sequence of events: 
1. The client brower requests the javascript file 
2. The Google Analytics server responds with the analytics.js file 
3. The client fetches, loads and executes the javascript which dynamically creates an <img> 
element in the DOM 
4. A GET from the browser hits the GA’s server with a URL containing appended values of the 
browser and the computer. This is an image/gif request. Example: 
http://www.google-analytics. 
com/collect?v=1&_v=j20&a=806449001&t=pageview&_s=1&dl=http%3A%2F%2Fwww.paradigmatecnologico.com% 
2F&ul=en-us&de=UTF-8&sd=24- 
bit&sr=1920x1080&vp=1920x199&je=1&fl=13.0%20r0&_u=MAC~&cid=416165610.1399537988&tid=UA-2282690- 
1&z=2140666386 
5. The server reads the data in the image URL and stores the hit (e.g. pageview or event) for 
logging and processing 
Introduction to Google Analytics -@RubenMartinezS 
6. The server responds with a single-pixel gif
The 3 most important variables: t, cid and tid 
o t=pageview // Pageview hit type 
o cid=416165610.1399537988 // Anonymous 
Client ID 
o tid=UA-2282690-1 // Tracking Web property 
ID 
Introduction to Google Analytics -@RubenMartinezS
Visualization of tags and scripts 
Introduction to Google Analytics -@RubenMartinezS 
The analytics.js 
JavaScript library 
uses a single cookie. 
The cookie contains 
an anonymous 
identifier used to 
distinguish users.
analytics.js Google Analytics cookies 
By default, the analytics.js library sets 
cookies on the top level domain, excluding 
the leading dot, and sets the cookie path 
to the root level (/). 
The name of the cookies is _ga 
Note: The analytics.js library does not 
require setting cookies to transmit data to 
Google Analytics. 
Introduction to Google Analytics -@RubenMartinezS
What you CAN do with Google Analytics 
• Track activity BEFORE pushing a brand new website or mobile app public 
• Report activity on private areas (protected by a login and/or disallowed to 
crawling bots) 
• Link to Adwords (CPC), GDN (CPM) and FDA (retargeting) 
• Associate engagement data from different devices and multiple sessions (great 
for attribution) 
• Upload transactional data of own userIDs if anonymized (great for e-commerce) 
• Integrate your Google Analytics data with other business applications, e.g. via 
API 
• Report activity across domains (tagging is however tedious and impractical) 
Introduction to Google Analytics -@RubenMartinezS
What you CANNOT do with Google Analyics 
• Generate leads (post-click marketing). Google Analytics does not provide IP 
addresses or the name of the company visiting a website for instance – and you 
should not upload this information either 
• Upload personally identifiable information (see userIDs above) 
• Carry out experiments across multiple domains (cross domain reporting OK but not 
tests A/B) 
• Report –efficiently- inventory on e-commerce websites with SKUs 
Introduction to Google Analytics -@RubenMartinezS
Metrics and dimensions 
Dimensions are attributes of 
• Visitors 
• Sessions 
• Hits: page, event 
The values of dimensions are strings. 
Metrics are counts (average integer or currencies). 
Values of metrics are numbers. 
Each custom dimension and metrics has an associated 
index. 
There is a maximum of 20 custom metrics and 
dimensions 
Introduction to Google Analytics -@RubenMartinezS
Event hits 
Some user actions do not generate pageviews. 
- completion of individual form fields (“Send”) 
- external, mailto: and pdf links 
- video play or complete 
- AJAX, Flash, jQuery or HTML5 interactions 
You want to tag some HTML elements as events. Event tracking turns a normal 
<a href=“/documents/e-book.pdf”> 
into 
<a href=“/documents/e-book.pdf” 
onclick=”ga(‘send’,’event’,’link’,’pdf’)”> 
Introduction to Google Analytics -@RubenMartinezS
Metrics and dimensions 
For example, if your page is scripted in PHP, the actual author of the page will 
probably be stored in a PHP variable like $author. In your PHP template, you can 
use this author variable to pass the author value to the custom dimension 
ga('send', 'pageview', { 'dimension5': 
'<?=$author?>' }); 
Introduction to Google Analytics -@RubenMartinezS
Content Experiments based on a multi-armed bandit 
Introduction to Google Analytics -@RubenMartinezS 
approach
Google Analytics Universal is user-centric 
Advertisers cannot track users as individuals anymore due to the proliferation of 
smartphones. Cookies reside in desktop browsers. Cookies are not used by mobile apps and 
browsers such as Safari on iphones. 
The identification of users and their sessions takes place now at server level on Universal, 
not browser/cookie level. 
Cookies are still used but Google warns that their format might change without warning. 
Hence developers should not directly access the cookie analytics.js sets as it could lead to 
script errors and incorrect data. 
Instead, developers should use the get command to retrieve the clientId value when 
needed. Here's how to do this: 
ga(function(tracker) { var clientId = 
tracker.get('clientId'); }); 
Introduction to Google Analytics -@RubenMartinezS
clientId for cross-device attribution 
You can use a custom visitor ID based on customer email or ID in your database to merge 
smartphone / laptop / pc sessions into one cross-device session. You can track users who login 
to your website (authenticated users) by associating their clientID to their email. 
<?if ($isAuthenticatedUser):?> 
ga('create', 'UA-XXXX-Y', {'clientId': '<?=md5($email)?>' }); 
<?else:?> 
ga('create', 'UA-XXXX-Y'); 
<?endif;?> 
All users who sign in to your website will be tracked across all devices. 
GA uses cookie value + domain as a unique internal identifier. If two or more websites set up 
the same client ID value based on customer email, the data won't be corrupted, because they 
are using different domains (and different GA profile id). 
Introduction to Google Analytics -@RubenMartinezS
Link your acquisitions, engagement, and 
conversions 
In a typical e-commerce scenario, you generate unique User_IDs through the authentication 
passed to an account at sign-in. The User ID will allow you to track for instance transactions 
and activity on per customer basis. 
To enable this feature, add the following line to your tracking code to send User-ID data to 
Google Analytics. 
ga('create', 'UA-XXXX-Y', { 'userId': 'USER_ID' }); 
ga('send', 'pageview'); 
where USER_ID is a string and represents the stable and unique ID retrieved from your 
system. 
You can then send anonymized data based on User_IDs to Google Analytics. 
Introduction to Google Analytics -@RubenMartinezS
Thank 
you! 
If you enjoyed these slides or have 
suggestions to improve them, let us know! 
@rubenmartinezs

More Related Content

Viewers also liked

Viewers also liked (6)

Transformación Digital
Transformación DigitalTransformación Digital
Transformación Digital
 
¿Cómo vencer a los dragones digitales?
¿Cómo vencer a los dragones digitales?¿Cómo vencer a los dragones digitales?
¿Cómo vencer a los dragones digitales?
 
Gestion del tiempo y GTD
Gestion del tiempo y GTDGestion del tiempo y GTD
Gestion del tiempo y GTD
 
Apuntes de GTD (productividad)
Apuntes de GTD (productividad)Apuntes de GTD (productividad)
Apuntes de GTD (productividad)
 
Seminario Apache Solr
Seminario Apache SolrSeminario Apache Solr
Seminario Apache Solr
 
Cultura Digital Paradigma
Cultura Digital ParadigmaCultura Digital Paradigma
Cultura Digital Paradigma
 

Similar to Google Analytics Intro for Web Dev

Getting Started with AdWords API and Google Analytics
Getting Started with AdWords API and Google AnalyticsGetting Started with AdWords API and Google Analytics
Getting Started with AdWords API and Google Analyticsmarcwan
 
Google Analytics for Beginners - Training
Google Analytics for Beginners - TrainingGoogle Analytics for Beginners - Training
Google Analytics for Beginners - TrainingRuben Vezzoli
 
Google Analytics & UX
Google Analytics & UXGoogle Analytics & UX
Google Analytics & UXKatrin Mathis
 
Understanding Google Analytics: Who's Oggling My Company
Understanding Google Analytics: Who's Oggling My CompanyUnderstanding Google Analytics: Who's Oggling My Company
Understanding Google Analytics: Who's Oggling My CompanyKimberly Swetland
 
Google Analytics with an Intro to Google Tag Manager for Austin WordPress Meetup
Google Analytics with an Intro to Google Tag Manager for Austin WordPress MeetupGoogle Analytics with an Intro to Google Tag Manager for Austin WordPress Meetup
Google Analytics with an Intro to Google Tag Manager for Austin WordPress MeetupRich Plakas
 
Understanding Web Analytics and Google Analytics
Understanding Web Analytics and Google AnalyticsUnderstanding Web Analytics and Google Analytics
Understanding Web Analytics and Google AnalyticsPrathamesh Kulkarni
 
Score google analytics
Score   google analyticsScore   google analytics
Score google analyticsHotTopics114
 
Introduction to Google Analytics
Introduction to Google AnalyticsIntroduction to Google Analytics
Introduction to Google AnalyticsCemal Buyukgokcesu
 
Google Analytics 101 #SMAMI 2017
Google Analytics 101 #SMAMI 2017Google Analytics 101 #SMAMI 2017
Google Analytics 101 #SMAMI 2017Nicole Bullock
 
Introduction to web analytics and the Google analytics platform pdf
Introduction to web analytics and the Google analytics platform pdfIntroduction to web analytics and the Google analytics platform pdf
Introduction to web analytics and the Google analytics platform pdfMartin Bloomfield
 
Google Analytics for SEO Beginners
Google Analytics for SEO BeginnersGoogle Analytics for SEO Beginners
Google Analytics for SEO BeginnersAditya Todawal
 
Google Analytics Workshop 2013
Google Analytics Workshop 2013Google Analytics Workshop 2013
Google Analytics Workshop 2013Milad Safarzadeh
 
Google Analytics & Web Masters Tools - GBG Mumbai
Google Analytics & Web Masters Tools - GBG MumbaiGoogle Analytics & Web Masters Tools - GBG Mumbai
Google Analytics & Web Masters Tools - GBG MumbaiGBG Mumbai
 
Google analytics and google data studio
Google analytics and google data studioGoogle analytics and google data studio
Google analytics and google data studioBrian Pichman
 
Track Report & Optimize Your Web Creations
Track Report & Optimize Your Web CreationsTrack Report & Optimize Your Web Creations
Track Report & Optimize Your Web CreationsEmpirical Path
 
Introduction to Google Analytics
Introduction to Google AnalyticsIntroduction to Google Analytics
Introduction to Google AnalyticsManeesh Choudhary
 
Google Business Tools
Google Business ToolsGoogle Business Tools
Google Business Toolsredcomin
 

Similar to Google Analytics Intro for Web Dev (20)

Getting Started with AdWords API and Google Analytics
Getting Started with AdWords API and Google AnalyticsGetting Started with AdWords API and Google Analytics
Getting Started with AdWords API and Google Analytics
 
Google Analytics for Beginners - Training
Google Analytics for Beginners - TrainingGoogle Analytics for Beginners - Training
Google Analytics for Beginners - Training
 
Google Analytics & UX
Google Analytics & UXGoogle Analytics & UX
Google Analytics & UX
 
Understanding Google Analytics: Who's Oggling My Company
Understanding Google Analytics: Who's Oggling My CompanyUnderstanding Google Analytics: Who's Oggling My Company
Understanding Google Analytics: Who's Oggling My Company
 
Google Analytics with an Intro to Google Tag Manager for Austin WordPress Meetup
Google Analytics with an Intro to Google Tag Manager for Austin WordPress MeetupGoogle Analytics with an Intro to Google Tag Manager for Austin WordPress Meetup
Google Analytics with an Intro to Google Tag Manager for Austin WordPress Meetup
 
Understanding Web Analytics and Google Analytics
Understanding Web Analytics and Google AnalyticsUnderstanding Web Analytics and Google Analytics
Understanding Web Analytics and Google Analytics
 
Score google analytics
Score   google analyticsScore   google analytics
Score google analytics
 
Introduction to Google Analytics
Introduction to Google AnalyticsIntroduction to Google Analytics
Introduction to Google Analytics
 
Google Analytics 101 #SMAMI 2017
Google Analytics 101 #SMAMI 2017Google Analytics 101 #SMAMI 2017
Google Analytics 101 #SMAMI 2017
 
Introduction to web analytics and the Google analytics platform pdf
Introduction to web analytics and the Google analytics platform pdfIntroduction to web analytics and the Google analytics platform pdf
Introduction to web analytics and the Google analytics platform pdf
 
Google Analytics for SEO Beginners
Google Analytics for SEO BeginnersGoogle Analytics for SEO Beginners
Google Analytics for SEO Beginners
 
Google Analytics Workshop 2013
Google Analytics Workshop 2013Google Analytics Workshop 2013
Google Analytics Workshop 2013
 
Adobe part 1
Adobe part 1Adobe part 1
Adobe part 1
 
Google’s tridente
Google’s tridenteGoogle’s tridente
Google’s tridente
 
Google Analytics & Web Masters Tools - GBG Mumbai
Google Analytics & Web Masters Tools - GBG MumbaiGoogle Analytics & Web Masters Tools - GBG Mumbai
Google Analytics & Web Masters Tools - GBG Mumbai
 
Google analytics and google data studio
Google analytics and google data studioGoogle analytics and google data studio
Google analytics and google data studio
 
Track Report & Optimize Your Web Creations
Track Report & Optimize Your Web CreationsTrack Report & Optimize Your Web Creations
Track Report & Optimize Your Web Creations
 
Introduction to Google Analytics
Introduction to Google AnalyticsIntroduction to Google Analytics
Introduction to Google Analytics
 
Tracking across devices
Tracking across devices Tracking across devices
Tracking across devices
 
Google Business Tools
Google Business ToolsGoogle Business Tools
Google Business Tools
 

More from Paradigma Digital

Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.Paradigma Digital
 
Java 8 time to join the future
Java 8  time to join the futureJava 8  time to join the future
Java 8 time to join the futureParadigma Digital
 
Programación Reactiva con Spring WebFlux
Programación Reactiva con Spring WebFluxProgramación Reactiva con Spring WebFlux
Programación Reactiva con Spring WebFluxParadigma Digital
 
Orquestando microservicios como lo hace Netflix
Orquestando microservicios como lo hace NetflixOrquestando microservicios como lo hace Netflix
Orquestando microservicios como lo hace NetflixParadigma Digital
 
Meetup microservicios: API Management
Meetup microservicios: API ManagementMeetup microservicios: API Management
Meetup microservicios: API ManagementParadigma Digital
 
Meetup de kubernetes, conceptos básicos.
Meetup  de kubernetes, conceptos básicos.Meetup  de kubernetes, conceptos básicos.
Meetup de kubernetes, conceptos básicos.Paradigma Digital
 
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptxDocker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptxParadigma Digital
 
Implementando microservicios
Implementando microserviciosImplementando microservicios
Implementando microserviciosParadigma Digital
 
Equipo de Marketing de Paradigma Digital
Equipo de Marketing de Paradigma DigitalEquipo de Marketing de Paradigma Digital
Equipo de Marketing de Paradigma DigitalParadigma Digital
 
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!Paradigma Digital
 
Manuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octManuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octParadigma Digital
 
Programación Reactiva con RxJava
Programación Reactiva con RxJavaProgramación Reactiva con RxJava
Programación Reactiva con RxJavaParadigma Digital
 

More from Paradigma Digital (20)

Ddd + ah + microservicios
Ddd + ah + microserviciosDdd + ah + microservicios
Ddd + ah + microservicios
 
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
 
Have you met Istio?
Have you met Istio?Have you met Istio?
Have you met Istio?
 
Linkerd a fondo
Linkerd a fondoLinkerd a fondo
Linkerd a fondo
 
Horneando apis
Horneando apisHorneando apis
Horneando apis
 
Java 8 time to join the future
Java 8  time to join the futureJava 8  time to join the future
Java 8 time to join the future
 
Programación Reactiva con Spring WebFlux
Programación Reactiva con Spring WebFluxProgramación Reactiva con Spring WebFlux
Programación Reactiva con Spring WebFlux
 
Orquestando microservicios como lo hace Netflix
Orquestando microservicios como lo hace NetflixOrquestando microservicios como lo hace Netflix
Orquestando microservicios como lo hace Netflix
 
Meetup microservicios: API Management
Meetup microservicios: API ManagementMeetup microservicios: API Management
Meetup microservicios: API Management
 
Meetup de kubernetes, conceptos básicos.
Meetup  de kubernetes, conceptos básicos.Meetup  de kubernetes, conceptos básicos.
Meetup de kubernetes, conceptos básicos.
 
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptxDocker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
 
Implementando microservicios
Implementando microserviciosImplementando microservicios
Implementando microservicios
 
Equipo de Marketing de Paradigma Digital
Equipo de Marketing de Paradigma DigitalEquipo de Marketing de Paradigma Digital
Equipo de Marketing de Paradigma Digital
 
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
 
Overview atlas (1)
Overview atlas (1)Overview atlas (1)
Overview atlas (1)
 
Manuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octManuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4oct
 
Programación Reactiva con RxJava
Programación Reactiva con RxJavaProgramación Reactiva con RxJava
Programación Reactiva con RxJava
 
Python y Flink
Python y FlinkPython y Flink
Python y Flink
 
Kafka y python
Kafka y pythonKafka y python
Kafka y python
 
Introducción a Kubernetes
Introducción a KubernetesIntroducción a Kubernetes
Introducción a Kubernetes
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Google Analytics Intro for Web Dev

  • 1. Introduction to Google Analytics for web developers Rubén Martínez
  • 2. Google Analytics reports incoming traffic to webs and apps This graph compares the count of visitors from Google organic search to a website in two periods of time. The story it is telling us is good news: the organic traffic markedly increased in a given month over the same period of the previous year (due to a previous investment in content and SEO). Introduction to Google Analytics -@RubenMartinezS
  • 3. Google Analytics helps understand your visitors’ flows Traffic volume by channel e.g. sessions per campaign and geolocation Engagement • Depth • Density • Duplication Content • A/B testing • Path Analysis Introduction to Google Analytics -@RubenMartinezS
  • 4. Google Analytics is: • A platform to track online and off-line activity of aggregated and anonymized visitors’ data • A behavioural reporting platform of activity of web visitors and end-users • A bread-and-butter tool for webmasters and marketing and business analysts • A (peculiar) dashboard interface and a well documented API Introduction to Google Analytics -@RubenMartinezS
  • 5. 2 Web Analytics platforms: GA and SiteCatalyst Introduction to Google Analytics -@RubenMartinezS Number of websites using Google Universal Analytics (left) vs. Omniture SiteCatalyst (below). Graphs with the same vertical scale and similar periods of time. Source: builtwith.com
  • 6. Organization of the platform Developers can access Google Analytics via a front interface, client libraries and APIs. This is how each components and APIs are organized: Source: https://developers.google.com/analytics/devguides/platform/ Introduction to Google Analytics -@RubenMartinezS
  • 7. Google Analytics is NOT: • A transactional CRM tool Visitors’ individual data is owned by Google Inc. The end user has access to anonymized data only. • A reporting tool of websites only It can be configured to track offline and online activity from multiple devices, including smartphones, kiosks, consoles, etc. • A parser of web server logs • A KPI-centric Business Intelligence platform Introduction to Google Analytics -@RubenMartinezS
  • 8. Tracking code Sign up to Google Analytics. If are tracking a website on the admin panel, setup a property (URL). Then paste the code provided by Google (example below) on all the pages you want to track: <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-2282690-1', 'paradigmatecnologico.com'); ga('send', 'pageview'); </script> When the browser loads this script, it interprets the document.write and triggers a sequence of events leading to send hits to Google’s server. Introduction to Google Analytics -@RubenMartinezS
  • 9. Browsers sends hits to Google Analytics server Sequence of events: 1. The client brower requests the javascript file 2. The Google Analytics server responds with the analytics.js file 3. The client fetches, loads and executes the javascript which dynamically creates an <img> element in the DOM 4. A GET from the browser hits the GA’s server with a URL containing appended values of the browser and the computer. This is an image/gif request. Example: http://www.google-analytics. com/collect?v=1&_v=j20&a=806449001&t=pageview&_s=1&dl=http%3A%2F%2Fwww.paradigmatecnologico.com% 2F&ul=en-us&de=UTF-8&sd=24- bit&sr=1920x1080&vp=1920x199&je=1&fl=13.0%20r0&_u=MAC~&cid=416165610.1399537988&tid=UA-2282690- 1&z=2140666386 5. The server reads the data in the image URL and stores the hit (e.g. pageview or event) for logging and processing Introduction to Google Analytics -@RubenMartinezS 6. The server responds with a single-pixel gif
  • 10. The 3 most important variables: t, cid and tid o t=pageview // Pageview hit type o cid=416165610.1399537988 // Anonymous Client ID o tid=UA-2282690-1 // Tracking Web property ID Introduction to Google Analytics -@RubenMartinezS
  • 11. Visualization of tags and scripts Introduction to Google Analytics -@RubenMartinezS The analytics.js JavaScript library uses a single cookie. The cookie contains an anonymous identifier used to distinguish users.
  • 12. analytics.js Google Analytics cookies By default, the analytics.js library sets cookies on the top level domain, excluding the leading dot, and sets the cookie path to the root level (/). The name of the cookies is _ga Note: The analytics.js library does not require setting cookies to transmit data to Google Analytics. Introduction to Google Analytics -@RubenMartinezS
  • 13. What you CAN do with Google Analytics • Track activity BEFORE pushing a brand new website or mobile app public • Report activity on private areas (protected by a login and/or disallowed to crawling bots) • Link to Adwords (CPC), GDN (CPM) and FDA (retargeting) • Associate engagement data from different devices and multiple sessions (great for attribution) • Upload transactional data of own userIDs if anonymized (great for e-commerce) • Integrate your Google Analytics data with other business applications, e.g. via API • Report activity across domains (tagging is however tedious and impractical) Introduction to Google Analytics -@RubenMartinezS
  • 14. What you CANNOT do with Google Analyics • Generate leads (post-click marketing). Google Analytics does not provide IP addresses or the name of the company visiting a website for instance – and you should not upload this information either • Upload personally identifiable information (see userIDs above) • Carry out experiments across multiple domains (cross domain reporting OK but not tests A/B) • Report –efficiently- inventory on e-commerce websites with SKUs Introduction to Google Analytics -@RubenMartinezS
  • 15. Metrics and dimensions Dimensions are attributes of • Visitors • Sessions • Hits: page, event The values of dimensions are strings. Metrics are counts (average integer or currencies). Values of metrics are numbers. Each custom dimension and metrics has an associated index. There is a maximum of 20 custom metrics and dimensions Introduction to Google Analytics -@RubenMartinezS
  • 16. Event hits Some user actions do not generate pageviews. - completion of individual form fields (“Send”) - external, mailto: and pdf links - video play or complete - AJAX, Flash, jQuery or HTML5 interactions You want to tag some HTML elements as events. Event tracking turns a normal <a href=“/documents/e-book.pdf”> into <a href=“/documents/e-book.pdf” onclick=”ga(‘send’,’event’,’link’,’pdf’)”> Introduction to Google Analytics -@RubenMartinezS
  • 17. Metrics and dimensions For example, if your page is scripted in PHP, the actual author of the page will probably be stored in a PHP variable like $author. In your PHP template, you can use this author variable to pass the author value to the custom dimension ga('send', 'pageview', { 'dimension5': '<?=$author?>' }); Introduction to Google Analytics -@RubenMartinezS
  • 18. Content Experiments based on a multi-armed bandit Introduction to Google Analytics -@RubenMartinezS approach
  • 19. Google Analytics Universal is user-centric Advertisers cannot track users as individuals anymore due to the proliferation of smartphones. Cookies reside in desktop browsers. Cookies are not used by mobile apps and browsers such as Safari on iphones. The identification of users and their sessions takes place now at server level on Universal, not browser/cookie level. Cookies are still used but Google warns that their format might change without warning. Hence developers should not directly access the cookie analytics.js sets as it could lead to script errors and incorrect data. Instead, developers should use the get command to retrieve the clientId value when needed. Here's how to do this: ga(function(tracker) { var clientId = tracker.get('clientId'); }); Introduction to Google Analytics -@RubenMartinezS
  • 20. clientId for cross-device attribution You can use a custom visitor ID based on customer email or ID in your database to merge smartphone / laptop / pc sessions into one cross-device session. You can track users who login to your website (authenticated users) by associating their clientID to their email. <?if ($isAuthenticatedUser):?> ga('create', 'UA-XXXX-Y', {'clientId': '<?=md5($email)?>' }); <?else:?> ga('create', 'UA-XXXX-Y'); <?endif;?> All users who sign in to your website will be tracked across all devices. GA uses cookie value + domain as a unique internal identifier. If two or more websites set up the same client ID value based on customer email, the data won't be corrupted, because they are using different domains (and different GA profile id). Introduction to Google Analytics -@RubenMartinezS
  • 21. Link your acquisitions, engagement, and conversions In a typical e-commerce scenario, you generate unique User_IDs through the authentication passed to an account at sign-in. The User ID will allow you to track for instance transactions and activity on per customer basis. To enable this feature, add the following line to your tracking code to send User-ID data to Google Analytics. ga('create', 'UA-XXXX-Y', { 'userId': 'USER_ID' }); ga('send', 'pageview'); where USER_ID is a string and represents the stable and unique ID retrieved from your system. You can then send anonymized data based on User_IDs to Google Analytics. Introduction to Google Analytics -@RubenMartinezS
  • 22. Thank you! If you enjoyed these slides or have suggestions to improve them, let us know! @rubenmartinezs