Element Click goals fire when visitors click specific page elements. Perfect for tracking CTA buttons, navigation, and outbound links.
When to Use Click Goals
Best for tracking:
- Call-to-action buttons
- Navigation menu clicks
- Download links
- Outbound links
- Video play buttons
- Any clickable element
Creating Click Goals
Goals live on each website's dashboard, under the Journeys tab.
Open the Journeys tab
From your website's dashboard, open the Journeys tab and select the Goals subtab.
Add a goal
Click Add Goal, then choose Element Click as the goal type.
Name the goal
Give it a clear name, like "Sign-up button" or "Pricing CTA".
Enter a CSS selector
In the CSS selector field, enter the selector that identifies the element to track.
Track value (optional)
Turn on Track monetary value if you want to attach a revenue value to each completion.
Create
Click Create to save the goal.
CSS Selectors
What's a CSS Selector?
A pattern that identifies HTML elements:
<button id="signup-btn" class="cta primary">
Sign Up
</button>
Selectors for this button:
#signup-btn(by ID).cta(by class)button.primary(by tag and class)
Common Selectors
| Selector | Matches |
|---|---|
#my-id | Element with id="my-id" |
.my-class | Elements with class="my-class" |
button | All button elements |
a.download | Links with class="download" |
[data-action] | Elements with data-action attribute |
Finding the Right Selector
Method 1: Browser Inspector
- Right-click the element
- Choose "Inspect"
- Find the element in DevTools
- Look for unique id or class
Method 2: Test in Console
- Open browser console (F12)
- Type:
document.querySelector('your-selector') - If the element is returned, the selector works
Selector Best Practices
Use IDs When Available
Most reliable option:
<button id="cta-signup">Sign Up</button>
Selector: #cta-signup
Use Specific Classes
If no ID, use descriptive class:
<button class="btn btn-primary cta-main">Get Started</button>
Selector: .cta-main
Avoid Generic Selectors
| Bad | Problem |
|---|---|
button | Matches all buttons |
.btn | Too common |
a | All links |
| Good | Why |
|---|---|
#signup-cta | Unique ID |
.cta-signup | Specific class |
[data-goal="signup"] | Purpose-built |
Add Data Attributes
Ask developers to add trackable attributes:
<button data-goal="signup" class="btn">Sign Up</button>
Selector: [data-goal="signup"]
Common Examples
CTA Buttons
| Goal | Selector |
|---|---|
| Main CTA | #hero-cta |
| Secondary CTA | .cta-secondary |
| Pricing CTA | .pricing-cta |
Navigation
| Goal | Selector |
|---|---|
| Pricing link | a[href="/pricing"] |
| Contact link | nav a[href="/contact"] |
| Sign in | .nav-signin |
Downloads
| Goal | Selector |
|---|---|
| Any download | a[download] |
| PDF downloads | a[href$=".pdf"] |
| Specific file | a[href="/files/guide.pdf"] |
Outbound Links
| Goal | Selector |
|---|---|
| External links | a[target="_blank"] |
| Affiliate links | a[href*="partner.com"] |
| Social links | .social-links a |
Advanced Selectors
Attribute Selectors
| Pattern | Matches |
|---|---|
[attr] | Has attribute |
[attr="value"] | Exact match |
[attr*="value"] | Contains |
[attr^="value"] | Starts with |
[attr$="value"] | Ends with |
Combinators
| Pattern | Matches |
|---|---|
div button | Button inside div |
div > button | Direct child button |
button:first-child | First button |
button:not(.disabled) | Not disabled |
Examples
/* Links to external sites */
a[href^="http"]:not([href*="mysite.com"])
/* Submit buttons not disabled */
button[type="submit"]:not(:disabled)
/* Download links in content area */
.content a[href$=".pdf"]
How Clicks Are Counted
A click goal completes once per visitor session. Zenovay records the first matching click in a session and ignores later clicks on the same element within that session, so a visitor who clicks twice counts as one conversion. The same visitor returning in a new session can complete the goal again.
If you want to track a specific click only on certain pages, scope it at the selector level by combining the click selector with a parent that only exists on those pages, or use a URL Match goal for page-based conversions.
Dynamic Elements
Elements Added After Page Load
Click tracking is attached at the document level, so it works for elements that appear after the initial page load, including content rendered by JavaScript frameworks.
Testing Dynamic Elements
- Load the page
- Wait for the element to appear
- Click the element
- Verify the goal fires
Troubleshooting
Clicks Not Tracking
Check the selector:
// In browser console
document.querySelector('your-selector')
// Should return the element
Check element visibility:
- Is the element visible when clicked?
- Is it hidden or covered by another element?
Wrong Elements Matching
Make the selector more specific:
- Add parent context
- Use a more unique class
- Add a data attribute
Delayed Load Elements
If the element loads after the page:
- Most cases work automatically
- Test thoroughly
- Consider a custom event goal if issues persist
Best Practices
Plan Your Selectors
Before implementing:
- Identify key CTAs
- Ensure unique identifiers
- Document selectors
- Test across pages
Work with Developers
Request:
- Unique IDs on key CTAs
- Data attributes for tracking
- Consistent naming conventions
Test Thoroughly
- Click the element yourself
- Check the Live View
- Verify the goal recorded
- Test on mobile too