Skip to content

funnelbranch/funnelbranch-script

Repository files navigation

❌ Funnelbranch has been discontinued ❌

❌ The script will no longer work.

Funnelbranch Script

This is the official source code repository for the funnelbranch.js script.

For more information, please visit www.funnelbranch.com.

Script Tag

Include the following script tag on every HTML page.

<script src="https://js.funnelbranch.com/funnelbranch.js?projectId=<PROJECT_ID>"></script>

Script Tag Options

The script tag can also be initialized with query parameter options, like this

<script src="https://js.funnelbranch.com/funnelbranch.js?projectId=<PROJECT_ID>&cookieDomain=<COOKIE_DOMAIN>&enableLocalhost=true"></script>

Have a look at the manual setup guide below for an overview of all options.

Manual Setup

First: include the same script tag on every HTML page, but omit any query parameters. Second: manually initialize Funnelbranch via the Funnelbranch.initialize(...) method.

<script src="https://js.funnelbranch.com/funnelbranch.js"></script>
<script>
  const funnelbranch = Funnelbranch.initialize('<PROJECT_ID>', options);
  // The second "options" parameter is not mandatory
</script>

Here's an overview of all possible options.

type Options = {
  controlGroup?: 'A' | 'B';
  // Default: undefined

  cookieDomain?: string;
  // Default: current domain

  enableLocalhost?: boolean;
  // Default: false

  trackClientUrlChanges?: boolean;
  // Default: true

  trackClientHashChanges?: boolean;
  // Default: false
};

Instance API

Custom actions can be submitted via the submitAction() method.

funnelbranch.submitAction('<ACTION_NAME>');

To stop tracking client-side URLs and cancel all browser API subscriptions, use the destroy() method.

funnelbranch.destroy();

Note that if you're using automatic script tag initialization, the Funnelbranch instance is automatically made available under window.funnelbranch.

Frameworks (React, Angular)

Check out the official Funnelbranch Script Wrapper (NPM) module for using this script with SPA frameworks like React and Angular.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published