Some Advanced
Tracking in Google
Analytics
...with JavaScript, of course!
I’m Nico
I work at SEER Interactive
I do technical analytics implementation
I also run some SEO projects
I like JavaScript...
But Mostly...
I LIKE DATA
…and like collecting it
You need Async or Universal Code
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXX...
Event Tracking
_gaq.push(['_trackEvent',
'Videos',
'Play',
'B-day'
Google
Documentation:
nnii.co/19QcDBV
Event Tracking
_gaq.push(['_trackEvent',
'Videos', // category
'Play', //action
'B-day' //label
Google
Documentation:
nnii...
Custom Variables
Cookie the visitor.
Bucket them based on an
action.
Segment them
Tell me what they do
compared to other p...
Custom Variables
_gaq.push(['_setCustomVar',
1,
'Items Removed',
'Yes',
2
]);
Custom Variables
_gaq.push(['_setCustomVar',
1, // slot #1.
Required
'Items Removed', // Category for the user
activity. R...
Scope
3 Cool Things to Track
How do people use your form?
What links are getting clicked on the most?
Are people readers or scan...
Are people clicking on my links?
You should make sure its getting downloaded,
viewed and visited.
Full post: nnii.co/ext-l...
What are people REALLY doing on
this page?
Form Tracker
var array1 = [];
$(document).ready(function () {
$('input').change(function () {
var formbox = $(this).attr('...
Output - Form Tracker
JS Fiddle: nnii.co/js-adv-form-tracker
Are people actually reading what I
am writing?
Credit: Justin Cutroni, Google
Full post - http://nnii.co/jc-scroll-track
What Does This Say?
 About 82% that load the article start reading (daily
avg = 82%)
 About 55% make it to the bottom of...
THANKS!
Have fun with it!
Twitter: @nicomiceli
G+: gplus.to/nicomiceli
Presentation:
nnii.co/js-meetup-track
Upcoming SlideShare
Loading in …5
×

Some Advanced Tracking in Google Analytics in 5 mins - PhillyJS meet up

472 views

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
472
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Some Advanced Tracking in Google Analytics in 5 mins - PhillyJS meet up

  1. 1. Some Advanced Tracking in Google Analytics ...with JavaScript, of course!
  2. 2. I’m Nico I work at SEER Interactive I do technical analytics implementation I also run some SEO projects I like JavaScript & R and a lil’ bit of python
  3. 3. But Mostly... I LIKE DATA …and like collecting it
  4. 4. You need Async or Universal Code <script type="text/javascript"> 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); })(); </script>
  5. 5. Event Tracking _gaq.push(['_trackEvent', 'Videos', 'Play', 'B-day' Google Documentation: nnii.co/19QcDBV
  6. 6. Event Tracking _gaq.push(['_trackEvent', 'Videos', // category 'Play', //action 'B-day' //label Google Documentation: nnii.co/19QcDBV
  7. 7. Custom Variables Cookie the visitor. Bucket them based on an action. Segment them Tell me what they do compared to other people
  8. 8. Custom Variables _gaq.push(['_setCustomVar', 1, 'Items Removed', 'Yes', 2 ]);
  9. 9. Custom Variables _gaq.push(['_setCustomVar', 1, // slot #1. Required 'Items Removed', // Category for the user activity. Required 'Yes', // value of the custom variable. Required. 2 // Sets the scope to session-level. Optional ]);
  10. 10. Scope
  11. 11. 3 Cool Things to Track How do people use your form? What links are getting clicked on the most? Are people readers or scanners?
  12. 12. Are people clicking on my links? You should make sure its getting downloaded, viewed and visited. Full post: nnii.co/ext-links-tracking Post credit: Blast Marketing $('a').click(function(){ //only external links _gaq.push(['_trackEvent','Ext-links', 'clicked','External']); }); Credit: Blast Analytics
  13. 13. What are people REALLY doing on this page?
  14. 14. Form Tracker var array1 = []; $(document).ready(function () { $('input').change(function () { var formbox = $(this).attr('id'); array1.push(formbox); console.log("you filled out box " + array1); }); $('#submit').click(function () { console.log('tracked ' + array1); alert('this is the order of boxes you filled out: ' + array1); //_gaq.push(['_trackEvent', 'Form', 'completed', '"' + array1 + '"']); }); }); JS Fiddle: nnii.co/js-adv-form-tracker
  15. 15. Output - Form Tracker JS Fiddle: nnii.co/js-adv-form-tracker
  16. 16. Are people actually reading what I am writing? Credit: Justin Cutroni, Google Full post - http://nnii.co/jc-scroll-track
  17. 17. What Does This Say?  About 82% that load the article start reading (daily avg = 82%)  About 55% make it to the bottom of the content (daily avg = 63%)  About 14% make it to the bottom of the page (daily avg = 18%)
  18. 18. THANKS! Have fun with it! Twitter: @nicomiceli G+: gplus.to/nicomiceli Presentation: nnii.co/js-meetup-track

×