Track transitions/virtual page views in single-page apps.
Track non-page view events, such as in-page dialogs or video/media playback.
NOTE: If you use Google Tag Manager to use Leadfeeder Tracker, remember to add <script> before the script and </script> to the end of the script.
The Leadfeeder tracker script exposes a set of methods for the web page to call if needed. All these methods exist under the window.ldfdr -object in the page.
Sends a page view event. It supports arguments as an object.
pageTitle: "Example page"
If the arguments are not present, it will default to window.location.href for pageUrl and document.title for pageTitle.
For SPA tracking, calling window.ldfdr.pageview()without arguments after a state change is usually enough as new pageUrl and pageTitle will be automatically picked up.
Additionally, you might want to prevent double tracking by disabling automatic sending of the tracking event on each page load. This change needs to be done inside the code snippet used for loading the tracking script (check GTM or your website's code).
If you use Leadfeeder’s Google Tag Manager template, another option is that you unselect Automatic tracking as shown in the picture below:
Returns an array of all tracker instances on the page. See getTracker() below for details on how to interact with the tracker instances.
Get a tracker instance by trackerId. For the tracker instance following methods are supported:
var tracker = window.ldfdr.getTracker("abcdef");
// Sends a pageview to specific tracker, supports
//same arguments as pageview() above
You can obtain the Leadfeeder clientId with the following call:
ClientID is the visitor ID that is stored in the Leadfeeder cookie. It matches to the lf_client_id field that is returned from the Leadfeeder API's visits end-point.
STEP 1: Add a new Custom HTML tag in your Google Tag Manager.
STEP 2: Name as appropriate.
STEP 3: Add the following code to HTML section:
STEP 4: Configure a trigger for "History change".
STEP 5: Test in Google Tag Manager’s Debug mode.