Using our Javascript tracking (V1)

Avatar

By Zeno

updated about 1 month ago

Please note -- we have now released a version 2 Javascript tracking code and API. This documentation is kept since users may still have the old JS in use. Do not use this documentation if you are implementing JS tracking for the first time.

FunnelFlux Pro offers JavaScript (JS) tracking for your page views and conversions.

This allows you to direct-link to pages, without redirection through a tracking link, and still get full functionality tracking.

The only limitation is that you can't have the tracker route to different page destinations on the way, but there is not much we can do about this if you choose not to use a "tracking" link.

Now, its important to note that this is NOT an either or situation -- you should use our JS as much as possible even if using redirect links, as it has many important functions aside from just tracking a page visitor arriving.

Check out our other JavaScript articles for more information:

Getting Started - Global Include

If you want to direct link to a page and have it track, or fire conversions with JS, you will need to place our JavaScript tracking code.

This is split into two parts. Think of our JS as similar to Google Analytics/FB tracking.

The first part is a generic JS file that you can globally include in your pages.

This code can be placed in the <head> section of all your pages. It is required before trying to track any views/conversions.

If you can't put it in <head>, just be sure to put it before the later codes.

You can retrieve this JS from lander/offer configuration or when generating links in the funnel builder.

Note the DOMAIN you use is one of your custom domains, and keep in mind the JS version (above 2.0.0) may change from time to time.

Tracking Page Views

Now that you have the above include placed, you can use this code to log a view to your lander/offer page:

Note there is a "p" value above -- this is the ID of the lander/offer page, which will be automatically added if you are copying this code from within the app.

With this p-value present, the tracker will know what page you are visiting even if your URL is dynamic, the page is iFramed, or delivered via some server-side include.

If you don't have the p-value present, we will check the current URL and match it to a page based on where we believe you are (i.e. what funnel/node).

All the other values like f, n, etc. are commented out by default -- you can replace these if you like, and if you generate JS via the Funnel Builder, some will be populated. They are there just for reference.

Direct Linking Your Campaigns to a Page

One of the most common use-cases for JavaScript is users running campaigns on Facebook, Google Ads, etc. where they want to avoid redirects.

In general, you don't need complicated or specific JS for every campaign and every page you use. It's better to put generic, simple JS then let the URL do the heavy lifting.

When you click a page node in the funnel builder (or get to this form through some other means), you can select Direct Linking and get a direct link + needed JavaScript code. 

Something like this:

Here, we give you a full URL to use for sending traffic to the page, for example:

https://DOMAIN/lander1.html?f=0CZMg0UdRyDl&n=0cukL46CqMMb&ts=0cG4YmZyW0JS

We also provide the base URL + URL suffix, making it easy to deal with sources like Facebook Ads, Google Ads, Microsoft Ads etc. where they provide a base ad URL box and a separate box for a URL suffix.

That URL suffix we produce has tracking parameters f (funnel), n (node) and ts (traffic source).

When you load a page using our direct links, our JS will automatically detect these parameters and use them, rather than any defaults in the JS code. This lets you use the same generic JS code in your pages, and use those pages in multiple funnels, without confusion.

This URL will also include the additional URL parameters of the traffic source, e.g.

...&campaign={{campaign.id}}&ad_id={{ad.id}}&adset_id={{adset.id}}

After our important tracking parameters, we can pass all data that a traffic source would usually pass into our redirect tracking link. You're going to put this link into the traffic source's ad URLs anyway, so you can use tokens and macros the traffic source has available, just like any other link.

So in general, place our JS on your pages generically, then be sure to get specific links for a page from your funnel builder if you want to use them in ads.

Did this answer your question?