jueves, 20 de marzo de 2014

Event tracking on my WebSite with Google Analytics

I needed to track an specific event on my website, and when I configured the conversions on GA, the results was null. I supposed there was a problem with the capture of that specific event in GA, because I noticed there were already a lot of visitors and a lot of interaction with that specific button but I haven't had any results.
Anyways, I went into the GA developers documentation, and here is what I found:

I needed to set the variables of the event inside the template (file) where I sited the google analytics tracking code, with these parameters:
ga('send', 'event', 'button', 'click', 'nav buttons', 4);
where
  • button is the category
  • click is the action
  • nav buttons is the label
  • 4 is the value
to be more specific (it could happen you have to buttons with the same type of interaction), then you can set the web page

ga('send', 'event', 'category', 'action', {'page': '/my-new-page'});
There are other things you can do, but this was good enough for me.

This is the link I used
https://developers.google.com/analytics/devguides/collection/analyticsjs/events




No hay comentarios:

Publicar un comentario