Set Up Event Tracking
Event Tracking lets you capture custom actions that happen on your website; like button clicks, downloads, video plays, or sign-ups, and report them as leads in WhatConverts. This helps you measure which interactions drive conversions and optimize your marketing accordingly.
Before you start, see What is Event Tracking? for an overview.
Enable Event Tracking
To activate Event Tracking in your profile:
- Go to "Tracking" from the top menu.
- Select "Events".
- Toggle "Enable Event Tracking" on.
- Click "Update Event Tracking" to save your changes.
Once enabled, you can start adding Event Tracking code to capture specific actions on your website.
Add the Event Tracking Code
To capture event data, add the Event Tracking code to your website alongside your WhatConverts tracking script.
The Event Tracking code must appear after your WhatConverts tracking script on the page.
Example event tracking code:
javascript
Javascript
<script type="text/javascript">
$wc_leads.track.event(
'User', // Replace with your event category (required)
'Signup', // Replace with your event action (required)
'New', // Replace with your event label (optional)
'5' // Replace with your event value (optional)
);
</script>
Common Event Tracking Examples
Event Tracking works for any custom action you want to measure. Here are some common use cases:
Button Clicks:
- Track clicks on "Get a Quote," "Schedule a Demo," or "Contact Us" buttons.
- Example: Category = Button, Action = Click, Label = Get a Quote.
File Downloads:
- Track PDF downloads, brochures, or whitepapers.
- Example: Category = Download, Action = PDF, Label = Product Brochure.
Video Engagement:
- Track video plays, pauses, or completions.
- Example: Category = Video, Action = Play, Label = Product Demo.
Sign-Ups:
- Track newsletter sign-ups, trial registrations, or account creations.
- Example: Category = User, Action = Signup, Label = Free Trial.
Link Clicks:
- Track clicks on external links, navigation items, or promotional banners.
- Example: Category = Link, Action = Click, Label = Partner Site.
Note: Event Tracking captures interactions that don't submit a form or make a phone call. For form submissions, use Web Form Tracking instead.
Track Clicks with Event Tracking
To track a specific button or link click, add the onclick attribute with the Event Tracking function to your HTML element.
Example code:
javascript
Javascript
<a onclick="wc_event_ypbib('Lead','Click','Example Text on Button');">Example Text on Button</a>
To customize this code:
- Replace 'Lead' with your event category (e.g., Button, Download, Link).
- Replace 'Click' with your event action (e.g., Click, Download, View).
- Replace both instances of 'Example Text on Button' with:
- First instance (inside the function): The event label you want to track.
- Second instance (after the closing >): The visible text or label users see.
Real-world example:
javascript
Javascript
<a onclick="wc_event_ypbib('Download','Click','Service Brochure');">Download Service Brochure</a>
In this example:
- Category: Download
- Action: Click
- Label: Service Brochure
- Visible text: "Download Service Brochure"
Add Additional Fields (Optional)
You can include extra information, such as a user's name, email address, or account ID, by modifying the Event Tracking code to pass additional fields.
Example with additional fields:
javascript
Javascript
<script type="text/javascript">
$wc_leads.track.event(
'User',
'Signup',
'New',
'5',
{
'Full Name': 'Joe Smith',
'Email Address': 'joe.smith@example.com'
}
);
</script>
This allows you to capture more context about who completed the action, making it easier to analyze user interactions and follow up with leads.
When to Use Event Tracking
Use Event Tracking when you want to:
- Measure micro-conversions like button clicks, downloads, or video plays.
- Track non-form interactions that indicate interest or engagement.
- Attribute actions to marketing sources to see which campaigns drive specific behaviors.
- Optimize campaigns by sending event data to ad platforms like Google Ads or Facebook Ads.
Related Topics
- What is Event Tracking?
- View Your Event Leads
- Set Up Web Form Tracking
- Set Up Call Tracking
- Set Up Appointment Tracking
Get a FREE presentation of WhatConverts
One of our marketing experts will give you a full presentation of how WhatConverts can help you grow your business.
Schedule a Demo