Back to Home

Install guides

A website needs one script tag in its head. An app needs one package and one line of setup. Pick your platform below.

Websites

Mobile apps

Your own events

Page views, clicks and errors are tracked for you. Send anything else, such as a signup or a purchase, with TF('track'). Events can be funnel steps, goals for A/B tests, or sent on with webhooks.

TF('track', 'signup');
TF('track', 'purchase', { amount: 49, currency: 'USD' });
TF('identify', 'user-42');

The script loads asynchronously. If your code can run before it does, add this line above it once, and calls made early are kept until the script is ready:

<script>window.TF = window.TF || function () { (window.__TF_Q__ = window.__TF_Q__ || []).push(arguments); };</script>

A/B tests

Create a test under Experiments in the dashboard (Pro plan) and start it. Then ask for the visitor's version where the page shows the change, and send the goal when the visitor converts:

TF('variant', 'new-pricing', function (version) {
  if (version === 'b') {
    // show the new version
  }
});

// when the visitor reaches the goal
TF('track', 'signup');

The callback gets the version id from the dashboard, or null for the original: the visitor isn't in the test, the test isn't running, or it couldn't load within 3 seconds. Hide the part that changes until the callback runs, so visitors don't see it flicker.

A visitor always gets the same version, on your website and in your app. The dashboard counts the goals each version reaches and calls a winner once one version has a 95% chance of being the best.

Create a free account to get your tracking ID, or open the demo to see what you get.