Javascript Trigger to Start Recording

 

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 Session Recording and Funnel Analytics but soon it will be available in others tools.

 

Using Trigger in Session Recordings

This example below shows you how to use a Javascript trigger in Session Recordings. In TruConversion there are two ways to set triggers:

  • Click to Record Specific Events: Choose specific events on the pages mentioned in URL section. Whenever a visitor arrives on mentioned pages and fire that specific event, the TruConversion will record all the activity of that visitor on the mentioned pages. This option is only available for Simple and Exact match pattern. For more, see this article Click to Record Specific Event
  • Javascript Trigger to Start Recording: Create and paste javascript triggers into any event in mentioned URL pages under page URL section to start recording.

 

Use Javascript Trigger to Start Recording:

This option is available for user while creating Recording campaign. Whenever a visitor arrives at site and fires that trigger, the TruConversion will record all the activity of that visitor on the mentioned pages.

Click on “Set Trigger” check box and enter the unique name of trigger, in next box the trigger script will appear. Copy and paste this code into any event at you site. As below:

 

Add this Javascript trigger code to your website:

In the example above, you’ve created a trigger called Freetrialbutton. Next, you will need to add the trigger code to your website:

Javascript Code
tcjs(‘trigger’,‘sr’,‘Freetrialbutton’);

Note: This code must be added at any point after the TruConversion Tracking Code. If it is added before, a Javascript error will occur.
If you wanted to record visitor when the user completed a specific action, you would add this line of code to one of your Javascript functions. Here’s an example:

For Example:
function submitForm() {
tcjs(‘trigger’,‘sr’,‘Freetrialbutton’);
}

 

How this trigger appears in Recording playback

This Javascript trigger will appear in visitor playback recording, only when this trigger is fired by the visitor while visiting above mentioned pages in enter URL section.

Blue Dot: This represents that visitor interaction with the trigger event either you have selected specific event or added manual javascript trigger on mentioned pages. Always assign unique name to your trigger because at hover it will show name of the trigger you set while creating.

Note: In case this trigger is placed in any event other then the pages mentioned in enter URL section, then the recording of the visitor will appears who fired this trigger and visited the pages mentioned for recording but the trigger event will not appear in the play back video.

 

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 type=”text/javascript”>tcjs(‘trigger’,’sr’,’unique-name-here’);</script>

For example:

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