2

Button clicks, links, or call-to-actions tracking

The main reason to track call to action buttons or links is for design feedback on landing or sales pages. This event is really meant to be a catch-all for designers to get feedback on what people are clicking on.

Using a single event like this will ensure your analytics events aren't polluted with a bunch of random events.

Choose a Generic Event

Rather than tracking all your call-to-action buttons and links with different events like  Green Signup Button ClickedFeatures from Top of Page Clicked, etc. we recommend choosing a single, generic event name to track all call to actions.

Here at Segment, we use  CTA Clicked for our generic event.

Add Details to the Event Properties

Now’s the fun part, since the event name is generic, we’ll rely on a rich library of event properties to do our analysis. Here are a bunch of example event properties that you might want to include in your CTA Clicked event.

location: 'top right corner'

color:  'green'

text: 'Get Started!'

CTA: 'Sign Up'

category: 'Landing Pages'

type: 'Button'

variation: 'Long Form'

version: '2.3.12'

pageSubject: 'Android SDK'

pageTitle: document.title

pageUrl: liveslocation.href

pagePathURL: location.pathname

Track Your CTAs

The easiest way to track Call to Actions is through our trackLink or trackFormhelpers in Analytics.js. Below is an example of a basic page with a link and a trackLink script to track that link:

...
<a href="/signup" id="signup1" class="green-button">Signup Here!</a>
...
<script type="text/javascript">
  var link = document.getElementById('signup1');
  analytics.trackLink(link, 'CTA Clicked', {
    location: 'Center',
    color: 'Green',
    text: 'Signup Here!',
    CTA: 'Signup',
    category: 'Home Page',
    type: 'Button',
    pageTitle: document.title
  });
</script>
...

It’s important that the trackLink or trackForm is called in the page below the link or form element to which it is being bound.

Check Out Your Events!

The last step is to see what your Call-To-Action events look like in some event tracking tools. We recommend Amplitude, Mixpanel, or Woopra.

Recommended Reading