Skip to main content

Activation based on Rage Clicks in Fullstory

O
Written by Optimize Team
Updated over 2 weeks ago

Want to have your experiment only run when rageclicks happen in Fullstory? This article describes how to make that happen in Webtrends Optimize

Key concepts

Optimize splits out the concept of delivering code as a whole from being able to count users as belonging to your experiment. These two component parts are important to what we're doing here.

You'll find solutions for using the Optimize Build Framework (OBF) or not, that handle both of these component parts.

Note: The solutions proposed here lean heavily on this Fullstory developer doc: https://developer.fullstory.com/browser/rage-clicks/#example-invocation. It is working and accurate as of the time the doc was written, but things change outside of our control.

Note: We have seen cases where the event fullstory/rageclick works, and times where fs:event works. You will need to try both to figure out what works for your website.

The two hooks we see are:

window.addEventListener(‘fullstory/rageclick’, function(e) {
doSomething(e);
});

and:

window.addEventListener('fs:event', function (event) {
if (event.detail && event.detail.eventType === 'rageclick') {
doSomething(event);
}
});

In the interest of comprehension of this topic, we'll stick with the first option in all of our solutions. Please use whichever works for you.

Are you using the OBF?

If you're using the Optimize Build Framework (OBF)

In the Run section of your OBF template, you'll find the following by default:

I.e. "poll for X and then go".

As this OBF doc describes, it's easy to wait for a user event.

Code example

Run: function(){

Test.pageview.suspend("don't count the user yet");

window.addEventListener(‘fullstory/rageclick’, function(e) {

// Ready to go
Test.pageview.track(); // Count the user now

Test.start('Rendering', Test.Render);
Test.start('Tracking', Test.Tracking);

});

}

If you're not using the Optimize Build Framework

In your pre-render script, you can use code similar to that described in this Conditional Activation doc.

Code example

/* @wt.parse="vm" */
WT.blockPV.push("$testAlias"); // Don't auto-count the user

window.addEventListener(‘fullstory/rageclick’, function(e) {

// Count them now
WT.optimize.lookup("$testAlias").track("pageview");

});

That's it! Couple of lines of code whichever approach you use.

Additional use case: Measurement

These events from Fullstory make for great guardrails. Instead of just using them to control exposure of your experience, we can also capture them as metrics.

Example, using the OBF:

window.addEventListener(‘fullstory/rageclick’, function(e) {

Test.conversion("fs_rageclick");

});

If you do this, you can then use our behavioural filters in the reporting to isolate those users who do or do not perform this action when analysing your test results:

Did this answer your question?