Digital Governance
cancel
Showing results for 
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)
Version history
Revision #:
1 of 1
Last update:
‎04-17-2019 02:39 PM
Updated by:
 
Contributors
Looking for more?
Ask in Discussions
Developers

Peer-to-peer support  and answers on developing CMS templates, modifying privacy scripts or building integrations.

Digital Experience Management

Find answers and ask questions on content management, personalization and targeting.

Digital Quality Management

Find answers and ask questions on WCAG and SEO quality management.

Digital Governance

Find answers and ask questions on consent and monitoring solutions.