DG and Privacy UX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Consent Solutions Knowledge Base

Add Google Analytics event tracking

Note: a Google Analytics ID is needed prior to setup. If you do not have one already, log in to your account to create one: 
https://analytics.google.com/analytics/web/

If you already have a Google Analytics account set up, setting up event tracking is easy.  Tracking can be used for events such as clicks, plays, etc.  Google Analytics is set up to receive information for Category, Action, Label and Value, so it is just a matter of configuring these events. 

1) Make sure you have the most current version of Google Analytics. If should be referencing "analytics.js"

2) Add your function:
<a href=”www.examplewebsite.com” onclick=”ga(‘send’, ‘event’, ‘Category’, ‘Action’, ‘Label’);”>
or
<script>

function handleClicks(event) {
  ga('send', 'event', {
    eventCategory: 'Category',
    eventAction: 'click',
    eventLabel: Label
  });
}

</script>

Labels (1)