Rich-text Reply

Custom Event Creation to Track Submissions

ergin 06-29-16

Custom Event Creation to Track Submissions

Hi,

 

I'm trying to create a custom event under one of my experiements to track submissions rather than using submission clicks. 

 

I have followed the instruction in this link created the custom event and went to javascript experiement but there's no code there. (please see the attached file)

 

I'd appreciate if you can show me how to add a custom event goal for my experience. Just to let you know the page link I'd like to track is: https://complyadvantage.com/pep-list/

 

PS: We don't have a success or thank you page

 

Thanks

Ergin

Level 2

Re: Custom Event Creation to Track Submissions

Hi Ergin,

 

Thanks for posting your question here. Optimizely doesn't auto-generate this code; you'll have to write this yourself.

 

What are you exactly trying to do: what is a submission? Looking at the page https://complyadvantage.com/pep-list/, would you like to track views of this page? Or clicks on a certain button? If you're looking to track pageviews of this page, you can have a look at the article here.

 

As for the custom event, to help you along: looking at your document, the "submission" is the custom event to track. In order to track this custom event, you need to use this line of code:

 

 

// sends a tracking call to Optimizely for the given event name. 
window.optimizely.push(["trackEvent", "eventName"]);

 

Here you replace the "eventName" with the custom event to track: "submission". Then you'll have to make sure you execute this conversion call only when you want to.

 

I hope this helps!

 

Nils

ergin 06-30-16
 

Re: Custom Event Creation to Track Submissions

Hi Nils,

 

Thanks for the reply, a few things still need clarification. 

 

1 - Submission: someone fills the form. 

2 - I'd like to track people who submit the form.

3 - Where do I need to add the code the below; on our website or optimizely > options > javascript experiment? 

 

Code: 

// sends a tracking call to Optimizely for the given event name.
window.optimizely.push(["trackEvent", "submissions"]);

 

Thanks

Ergin

Level 2

Re: Custom Event Creation to Track Submissions

Hi Ergin,

 

You can add the code both to your website or in Experiment JavaScript. This code by itself would fire on the page, so you'd need to add some code that it only fires when the form validates. This is unfortunately not something I can help you with. Do you have a web developer colleague who can help you with that?

 

You can ask your colleague if they can write you code that executes the code whenever a submission has gone through successfully. Code below:

 

 

// sends a tracking call to Optimizely for the given event name.
window.optimizely.push(["trackEvent", "submissions"]);

 

I hope this helps!

 

Best,

Nils

ergin 07-01-16
 

Re: Custom Event Creation to Track Submissions

Hi Nils,

 

Thanks for getting back to me, our developers will add the code. I'm still confused about the tracking process but let me add the code and test it Smiley Happy 

 

Thanks

Ergin

Level 2

Re: Custom Event Creation to Track Submissions

Perfect! Let me know if you can get it working.
ergin 07-05-16
 

Re: Custom Event Creation to Track Submissions

Hi Nis,

 

We couldn't figure out how to get this done. We're now doing split testing using different URLs so we won't need anymore what we've asked before. However, this time we've got another issue which I will raise under different topicSmiley Happy 

 

Thanks for your support. 

 

Regards

Ergin

Level 2