all about engagement with universal analytics @ google developer group nyc may meet up
DESCRIPTION
In this talk I discuss discuss ways that you can use the new version of Google Analytics (universal analytics) to measure the REAL engagement of your users, create new custom dimensions & metrics, track off site activities in Google Analytics and ways to track the same user across devices.TRANSCRIPT
![Page 1: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/1.jpg)
All about Engagement with
Universal Analytics
Nico Miceli+nico miceli|@nicomiceli
![Page 2: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/2.jpg)
At work:
- Marketer at the core
- Technical Analytics
@SEERInteractive
- GDE for Google
Analytics
![Page 3: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/3.jpg)
For Fun:
Hacker/Maker
People Watcher
Quantified Selfer
Curious Dude
![Page 4: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/4.jpg)
Who are you?
![Page 5: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/5.jpg)
First,
what is
engagement?
![Page 6: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/6.jpg)
I am going to talk
about:Event Tracking
Custom Dimensions
Cross Device Management
The Measurement Protocol
![Page 7: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/7.jpg)
![Page 8: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/8.jpg)
The old days
![Page 9: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/9.jpg)
Analytics
was easier
![Page 10: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/10.jpg)
But after
a couple
years…
![Page 11: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/11.jpg)
The web
got way
cooler
![Page 12: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/12.jpg)
![Page 13: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/13.jpg)
![Page 14: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/14.jpg)
![Page 15: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/15.jpg)
![Page 16: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/16.jpg)
Tracking got
harder
![Page 17: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/17.jpg)
With great power apps comes great
responsibility tracking needs
![Page 18: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/18.jpg)
Welcome to
Universal Analytics
![Page 19: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/19.jpg)
var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-XXXXX-X']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript';ga.async = true; ga.src = ('https:' == document.location.protocol ?'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s =document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga,s); })();
javascript
ga.js
Old
![Page 20: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/20.jpg)
(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-XXXXX-Y', 'nicomiceli.com');
ga('send', 'pageview');
analytics.jsjavascript
New!
![Page 21: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/21.jpg)
Thank You!
Any Questions?
![Page 22: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/22.jpg)
Just Kidding!It’s more than just an upgrade.
![Page 23: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/23.jpg)
![Page 24: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/24.jpg)
“Google Analytics
is becoming user
or customer
centric rather
than visit centric.”
- Justin Curtoni
Analytics Advocate,
Google Inc.
![Page 25: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/25.jpg)
Question 1
Are my users…
sharing pictures
watching videos
clicking links
having trouble with my forms
![Page 26: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/26.jpg)
Event TrackingShows how people are engaging with your site
![Page 27: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/27.jpg)
Event tracking is a GA method
that tracks engagement. It
consists of four values that
you can use to describe a
user's interaction
Value Type Required Description
Category String Yes Typically the object that was interacted with (e.g. button)
Action String Yes The type of interaction (e.g. click)
Label String No Useful for categorizing events (e.g. nav buttons)
Value Number No Values must be non-negative. Useful to pass counts (e.g. 4
times)
![Page 28: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/28.jpg)
Example Button Click<button id="b1">Click Me</button>
<script>
$('#b1').click(function(){
ga('send', // send command - REQUIRED
'event', // type of thing to send - REQUIRED
'category', // category of event - REQUIRED
'action', // action of the event - REQUIRED
'label', // the element that was clicked - OPTIONAL
5 // the value of the event that was clicked - OPTIONAL
);
});
</script>
ga('send','event','category','action','opt_label',opt_value)
![Page 29: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/29.jpg)
Don’t forget about
hidden content
Are people
viewing
your tabs?
$('#tabID').click(function(){
ga('send', // send command – REQUIRED
'event', // type of thing to send – REQUIRED
'tabs', // category of event – REQUIRED
'click', // action of the event – REQUIRED
$(this).id, // the element that was clicked - OPTIONAL
);
});
</script>
![Page 30: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/30.jpg)
There is
so
much
data in
Forms!
![Page 31: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/31.jpg)
Track interaction
with input boxes
with onblur
Post: bit.ly/1he1SRK by @iamchrisle
![Page 32: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/32.jpg)
Help users through
your forms by tracking
they’re errors
Post: bit.ly/1he1SRK by @iamchrisle
![Page 33: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/33.jpg)
![Page 34: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/34.jpg)
![Page 35: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/35.jpg)
The StatsShow stats from RCS infographic
![Page 36: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/36.jpg)
Drill down to NYC
![Page 37: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/37.jpg)
Track embeded
multimedia
![Page 38: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/38.jpg)
They all have Player
API’s!
![Page 39: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/39.jpg)
YouTube Event Tracking
Example//load youtube video with JavaScript API
function onYouTubePlayerAPIReady() {
player = new YT.Player('player', {
height: 390,
width: 640,
videoId: "videoidxyz",
events: {
'onStateChange': onPlayerStateChange
}
});
}
function onPlayerStateChange(event) {
switch (event.data) {
case YT.PlayerState.PLAYING:
ga("send", "event", "video", "play", "video name")
break;
case YT.PlayerState.ENDED:
ga("send", "event", "video", "end", "video name")
break;
case YT.PlayerState.PAUSED:
ga("send", "event", "video", "pause", "video name")
break;
}
}
![Page 40: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/40.jpg)
Wistia<div id="wistia_v059er99tw" class="wistia_embed" style="width:640px;height:426px;"> </div>
<script charset="ISO-8859-1" src="http://fast.wistia.com/assets/external/E-v1.js"> </script>
<script>
wistiaEmbed = Wistia.embed("video-id-here");
wistiaEmbed.bind('play',function() {
//console.log('play')
ga('send','event','video-wistia','play','wistia-video-1')
})
wistiaEmbed.bind('pause',function() {
//console.log('paused')
ga('send','event','video-wistia','pause','wistia-video-1')
})
wistiaEmbed.bind("end", function () {
//console.log('ended');
ga('send','event','video-wistia','ended','wistia-video-1')
});
</script>
![Page 41: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/41.jpg)
![Page 42: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/42.jpg)
![Page 43: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/43.jpg)
Question 2
Are my users engaged users…
buying
performing the desired 2nd action
requesting more information
![Page 44: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/44.jpg)
Custom DimensionsSend extra information to Google Analytics
![Page 45: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/45.jpg)
Custom Dimensions
allow you to push
custom data to Google
Analytics and group
things togetherNote: You only get 20 but they 1 can have multiple labels
![Page 46: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/46.jpg)
Set the Scope
The scope tells GA how
long the custom
dimensions should
follow the user
![Page 47: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/47.jpg)
3 Types of Scope
Hit - value is
applied to the
single hit for which
it has been set.
![Page 48: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/48.jpg)
Hit
What authors get viewed viewed the most?
Blog post 1 by Chris
Blog post 2 by Kevin
Blog post 3 by Nico
Blog post 4 by Kevin
Blog post 5 by Chris
Blog post 6 by Nico
Blog Post 7 by Kevin
Pageview=blog-1/ Pageview=/blog-5/ Pageview=/blog-4/ Pageview=/blog-2/
cd1_value=Author_Kevin cd1_value=Author_Nico cd1_value=Author_Kevin
cd1_value=Author_Kevincd1_value=Author_Nicocd1_value=Author_Chris
cd1_value=Author_Chris
Pageview=/blog-7/Pageview=/blog-2/Pageview=/blog-4/
![Page 49: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/49.jpg)
Processing
Every hit gets processed with the Custom Dimension of the author’s name
ClientID = 232
Session 1H1: pageview=/blog-post-1/ cd1_value=Author_Chris
H2: pageview =/blog-post-5/ cd1_value=Author_Kevin
ClientID = 343
Session 1
H1: pageview =/blog-post-4/ cd1_value=Author_Nico
H2: pageview =/blog-post-2/ cd1_value=Author_Kevin
H3: pageview =/blog-post-7/ cd1_value=Author_Chris
H4: pageview =/blog-post-6/ cd1_value=Author_Nico
H5: pageview =/blog-post-9/ cd1_value=Author_Kevin
![Page 50: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/50.jpg)
Reporting
Example Report
Author Blog posts Viewed
Author Nico 2
Author Kevin 3
Author Chris 2
![Page 51: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/51.jpg)
3 Types of Scope
Session - value is
applied to all hits in a
single session where
idle time is < 30 mins.
![Page 52: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/52.jpg)
Session
Do people who watch my videos end up converting?
Go product page
Watch video
Click on tabs
Read reviews
Sign up
Pageview=blog-1/ event= video, play, video1 event= tabs, click, info
Pageview=reviews/ event = forms, sign up, more info
Remember event tracking parameters = category, action, label
Cd2 = video watcher
Cd2 = video watcher
Video event triggers
custom dimension 2
![Page 53: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/53.jpg)
3 Types of Scope
User - value is applied to all
hits in current and future
sessions, until value changes
or custom dimension is made
inactive.
![Page 54: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/54.jpg)
UsersHow do the paid users differ from the free users
Go to site
Log inView blog
Listen to music
Go to siteView help
pageView blog
Listen to music
Pageview=/ Pageview = welcome Pageview= /blog/ event= music, play, song1
Pageview=/ Pageview=/help/ Pageview=/blog/ event= music, play, song2
Cd3 = video watcher
Cd3 = video watcher
Session 1
Session 2
![Page 55: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/55.jpg)
But what if they switch to
another device
Woz’s
travel bag
![Page 56: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/56.jpg)
we lost him… we can't find Stu the user
![Page 57: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/57.jpg)
Question 3
Are my users…
using different devices
performing different actions on
different devices
![Page 58: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/58.jpg)
Cross Device ManagementTrack users across different devices
![Page 59: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/59.jpg)
Client ID
Normally GA stores an
anonymous Client ID for
the user
![Page 60: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/60.jpg)
It starts with User-ID
feature - The user ID lets you create your own
persistent anonymous id and override GA’s
- You can tie hits & sessions to the same
users when they log in on different devices
![Page 61: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/61.jpg)
It starts with User-ID feature
Make sure the User ID is:
- Non-personally identifiable
- Unique to a user of your service or
app
- Persistent for a
signed-in user across
all devices
Web:ga('create', 'UA-XXXX-Y', 'auto');
if (auth.userSignedInVlaue) { ga('set', '&uid', {{ USER_ID }});};
ga('send', 'pageview');
Android:
t.set("&uid", {{ USER_ID }});
iOS:
[tracker set:@"&uid" value:{{ USER_ID }}];
![Page 62: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/62.jpg)
Setting it up in the App
- Enable
UserID
in Admin
- Make a new
View
![Page 63: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/63.jpg)
Things to note:1- the profile will only show hits with the
UserID present
2- number of Users is calculated based on
the number of unique User-ID values.
3- date range max will only be 90 days
4- Once you enable the User ID feature for
a view (profile), you cannot disable it.
![Page 64: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/64.jpg)
What can we learn from that?
Where your customers
research and where
they buy & how their
activity differs
![Page 65: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/65.jpg)
What can we learn from
that?
We can
see
device
overlap
reports
![Page 66: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/66.jpg)
& Device
paths!
![Page 67: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/67.jpg)
Question 4
What if the users…
aren’t on tablets or computers
do other things offline
![Page 68: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/68.jpg)
Measurement ProtocolMake HTTP requests to send raw user interaction data directly to Google Analytics servers.
![Page 69: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/69.jpg)
The measurement protocol lets you
send data to Google Analytics via
HTTP Requests to this endpoint.
http://www.google-analytics.com/collecthttp://ssl.google-analytics.com/collect
With these values required for all hitsName Parameter Example Description
Protocol Version v v=1 The protocol version. The
value should be 1.
Tracking ID tid tid=UA-123456-1 The ID that distinguishes to
which Google Analytics
property to send data.
Client ID cid cid=xxxxx An ID unique to a particular
user.
Hit Type t t=pageview The type of interaction
collected for a particular
user.
![Page 70: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/70.jpg)
![Page 71: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/71.jpg)
How about physical data?
![Page 72: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/72.jpg)
Lets test it
Offline ?
![Page 73: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/73.jpg)
Ok, it wasn’t that complicated
![Page 74: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/74.jpg)
Rasberry Pi + PIR Sensor +
lil’ Python = movement in GAimport time
import urllib2
import RPi.GPIO as io
io.setmode(io.BCM)
pir_pin = 18
io.setup(pir_pin, io.IN
def hitGA():
urllib2.urlopen("http://ww
w.google-
analytics.com/collect?v=1&
tid=UA-XXXXXX-
Y&cid=1111&t=event&ec=Move
ment&ea=livingRoom&el=desk
").close
while True:
if io.input(pir_pin):
hitGA()
Total cost $60
![Page 75: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/75.jpg)
Sleep Tracker v1
![Page 76: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/76.jpg)
At SEER we like to have events
![Page 77: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/77.jpg)
What’s a good area to track
![Page 78: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/78.jpg)
“We used a raspberry pi to track trips to the keg at #searchchurch in
Google analytics pic.twitter.com/tr9XLMSRRD by @NicoMiceli”
- @wilreynolds
![Page 79: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/79.jpg)
That was fun!
Now for the serious
examples!
![Page 80: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/80.jpg)
Client ID or User ID
Question Client ID User ID
What does the ID
Represent?
An anonymous device or browser instance. A single user, like a signed-in user account, that may interact with
content across one or more devices and / or browser instances.
How is the ID Set? Randomly generated and automatically sent
with all hits by Google Analytics libraries.
You must set and send your own userIds with your Google Analytics
hits.
How is ID Used to
Calculate Unique
Users?
In a non-User-ID-enabled view (profile), Client
ID is used to calculate unique users.
In a User-ID-enabled view (profile), User ID is used to calculate unique
users
There are two ways to associate a hit
to a user with the measurement
protocol
Examples: Lead gen vs eComm
![Page 81: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/81.jpg)
Lets talk Lead Gen
![Page 82: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/82.jpg)
The lead gen process
Go to siteBrowse around
Fill out form
Form goes to DB
BizDevfollows up with call
Lead turns to Qualified
BizDev sends proposal
Client signs agreement
New Lead
Nico
Miceli
CompanyX
.com
![Page 83: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/83.jpg)
What GA sees
Go to siteBrowse around
Fill out form
Form goes to DB
BizDev follows up with call
Thumbs Up!
Lead turns to Qualified
BizDev sends proposal
Client signs agreement
New Lead
Nico
Miceli
CompanyX
![Page 84: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/84.jpg)
Push the client ID with
your form
submissions… hindenly<form id="lead-form" method="POST" action="/lead">
<input id="name" type="text" /><BR>
<input id="phone" type="text" /><BR>
<!-- make a hidden input field and store the client ID in it -->
<input id="clientcookie" type="hidden" /><BR>
</form>
<script type="text/javascript">
$(document).ready(function(){
ga(function(tracker) {
clientID = tracker.get('clientId'); //grab the current users anonymous client ID
document.getElementById('clientcookie').value = clientID;
//set the value of client ID to the hidden input field
});
});
</script>
![Page 85: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/85.jpg)
ga(function(tracker) {var clientId = tracker.get('clientId');
});
<form id="lead-form" method="POST" action="/lead">
<input id="name" type="text" /><BR>
<input id="phone" type="text" /><BR>
<!-- make a hidden input field and store the client ID in it -->
<input id="clientcookie" type="hidden" /><BR>
</form>
<script type="text/javascript">
$(document).ready(function(){
ga(function(tracker) {
clientID = tracker.get('clientId'); //grab the current users anonymous client ID
document.getElementById('clientcookie').value = clientID;
//set the value of client ID to the hidden input field
});
});
</script>
![Page 86: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/86.jpg)
The lead gen process
Go to siteBrowse around
Fill out form
Form goes to DB
BizDevfollows up with call
Lead turns to Qualified
BizDev sends proposal
Client signs agreement
New Lead
Nico
Miceli
CompanyX
CID: 777
cid:777 cid:777
cid:777 cid:777
Send new data with the
Measurement protocol
![Page 87: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/87.jpg)
Get EmailGo to
eComm.comLog in to get
coupon
Print Out Coupon
Go to the eCommStore
Spend coupon +
$100
eComm to comm…
![Page 88: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/88.jpg)
Get EmailGo to
eComm.comLog in to get
coupon
Print Out Coupon
Go to the eCommStore
Spend coupon +
$100
eComm to comm
auth = true
![Page 89: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/89.jpg)
Get EmailGo to
eComm.comLog in to get
coupon
Print Out Coupon
Go to the eCommStore
Spend coupon +
$100
eComm to comm
auth = true
UID=123
UID=123 UID=123
![Page 90: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/90.jpg)
I can now see user pain
points in my app, learn
the impact of the bells &
whistle, I can understand
the users on across
devices, I can associate
them with real world
data.
![Page 91: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/91.jpg)
TL;DR Events
Use Google Analytics to track engagement via JS events
ga('send','event','category','action','opt_label
',opt_value)
![Page 92: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/92.jpg)
TL;DR Custom Dimensions
Allows you to group things and send more data to Google
Analytics
Step 1: Create a Name that you want to show up in reports
Step 2: Set the Scope
Step 3: Make it Active
![Page 93: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/93.jpg)
TL;DR Cross Device Management
Allows you to track a user across different devices
Step 1: Enable it in the web app
Step 2: Connect a persistent anonymous ID to each user
Step 3: Add it to your code
![Page 94: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/94.jpg)
TL;DR measurement Protocol
Allows you to send data to GA via HTTP Requests
Allows you to connect real world with internet world
The length of the entire encoded URL must be no longer than
2000 Bytes.
![Page 95: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/95.jpg)
Resources
Google Analytics Debugger Chrome Extension
Google Analytics Developer Google+ Community
Stack Overflow Google Analytics Tag
All links will be on my G+ page
tomorrow
Google.com/+nicomiceli
@nicomiceli
![Page 96: All about engagement with Universal Analytics @ Google Developer Group NYC May Meet Up](https://reader034.vdocuments.us/reader034/viewer/2022051613/54c655f64a7959e8238b461a/html5/thumbnails/96.jpg)
We’re Hiring! seer.is/jobbies