Javascript Trigger to Start Funnel

WHAT ARE JAVASCRIPT TRIGGERS?

This is a simple line of code. Which enables you to activate any of TruConversion feature at a specified moment during visitor session. For now this feature is available in Funnel Analytics and Session Recording but soon it will be available in others tools.  

USING JAVASCRIPT TRIGGERS IN FUNNEL ANALYTICS?

This example below shows you how to use a JavaScript trigger in funnel. 1. Select JavaScript trigger from your page targeting panel. You can add multiple Page URL and triggering rules in a single steps.

2. Enter a unique name for you trigger.

 Complete your funnel steps and click “Create Funnel”. 

3. Now add this trigger code to your website. Here is JavaScript Code:

tcjs(‘trigger’,’cf’, ‘unique-trigger-name’);

In the example above, you’ve created a trigger called startfunnel. Just replace “unique-trigger-name” with startfunnel and add this trigger code to your website:

tcjs(‘trigger’, ‘cf’, ‘startfunnel’);

Whenever this code is trigger by visitor your funnel step is marked as complete.  

USING JAVASCRIPT TRIGGER CODE IN IFRAME WINDOW

User can add javascript trigger code in iframe after placing TruConversion tracking code in iframe. This Triggering code can be added in button or any other event in iframe.  

USING JAVASCRIPT TRIGGER CODE THROUGH GOOGLE TAG MANAGER

If you are using Google Tag Manager to add our Javascript trigger then use this code:

<script>
var i = setInterval(function() {
if(typeof tcjs !== 'function') return;
clearInterval(i);
if(typeof console !== 'undefined') console.log('! tcjs has loaded, so executing that function now');
tcjs('trigger', 'sf_goal', ['vv2seofoj0uk', 698]);
}, 100);
</script>

For example:

Note: This code must be added after the TruConversion Tracking Code. If it is added before, a JavaScript error will occur.

Related Links: