Rich-text Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Track Click event (goal) triggered by jQuery
saggarwal 08-28-15
Track Click event (goal) triggered by jQuery
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
In variation, I have the following code:
jQuery("#link_id").click(); //trigger click event from the code
in goals, I want to track clicks on #link_id
But Optimizely is not tracking the clicks. Any idea why?
Sandeep Aggarwal
Certifications, Optimizely
Certifications, Optimizely
MartijnSch 09-01-15
Re: Track Click event (goal) triggered by jQuery
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Have you considered using that exact click event and triggering an event in the code of Optimizely as well so you could use that as custom event in the goal settings of your test?

Re: Track Click event (goal) triggered by jQuery
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
In my case, the click event on the Control was tracking fine but not in the Variation because in the Variation, click event was triggered from the code.
Adding the following line of code before raising the click event did the trick:
window.optimizely.push(["trackEvent", "control_click_event_name_here"]);
I guess, you meant the same. Thanks.
Adding the following line of code before raising the click event did the trick:
window.optimizely.push(["trackEvent", "control_click_event_name_here"]);
I guess, you meant the same. Thanks.
Sandeep Aggarwal
Certifications, Optimizely
Certifications, Optimizely