Purpose of This Guide

This guide explains how to install and use the External Tracking Script to record page views and track form submissions on external websites like WordPress, Shopify, Wix, Webflow, or custom HTML.

Use this setup if you:

  • Embed a Lead Connector form on an external website

  • Want page views and submissions tracked for attribution

  • Want to trigger workflows when those events occur

⚠️ External forms are not supported yet. The tracking script only recognizes and tracks internal forms embedded externally.

TABLE OF CONTENTS



What Is the External Tracking Script?

The tracking script is a small piece of JavaScript unique to your account.
 When placed on your external site, it:

  1. Records page views

  2. Tracks Lead Connector form submissions embedded on those pages

  3. Stores anonymous activity until the visitor becomes known

  4. Sends those tracked events to your CRM for reporting and workflow automation

It acts as the “bridge” that lets you see page activity from sites that aren’t hosted inside the platform.


Important Behavior Notes

⚠️ No contact or activity log will appear until a Lead Connector form submission occurs.

Here’s what happens:

  • Page views are anonymous until someone submits a form.

  • All prior anonymous activity is linked to the created/updated contact

  • Once a form is submitted, a contact is created or updated in the CRM.

This script does not:

  • Create contacts from external or custom HTML forms

  • Track third-party forms (WPForms, Gravity Forms, CF7, Elementor, etc.)

  • Track interactions or clicks

  • Track any form inside iframes or popups


Why You Need It

Without the tracking script, we cannot:

  • Record page views on external websites

  • Attribute leads or conversions to campaigns

  • Trigger workflows based on external activity

With the tracking script installed:

  • You can track our forms on external websites

  • You can measure page performance in the Attribution Report

  • You can trigger automations for visitors who submit a form


What It Does

Tracks:

  • Page views

  • Form submissions

  • Workflow triggers (based on above events)

Doesn’t track:

  • Scrolls, clicks, or time-on-page

  • Session-level analytics

  • Cross-domain behavior


Before You Start

  • The site domain must be connected to your account.

  • The form must be a Lead Connector form embed

  • Forms inside iframes or popups won’t be tracked.


Step 1: Get Your Tracking Script

In your account:

  1. Go to Settings → External Tracking

  2. Click Copy Script

Your snippet will look like this:

<script 
  src="https://link.yourdomain.com/js/external-tracking.js"
  data-tracking-id="tk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
</script>

Do not modify your data-tracking-id. It’s unique to your account.


Step 2: Install the Script

Paste the script before the closing </body> tag on your website.

Option A: Add Directly (Recommended)

Example:

<!-- External Tracking Script -->
<script 
  src="https://link.yourdomain.com/js/external-tracking.js"
  data-tracking-id="tk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
</script>
</body>
</html>

Works for:

  • Custom HTML sites

  • WordPress

  • Wix / Squarespace / Webflow

Option B: Install via Google Tag Manager (GTM)

⚠️ Known Issue: GTM may remove the data-tracking-id attribute, breaking initialization.
If you see console errors like
 
LC Tracking: Missing data-tracking-id attribute,
 your GTM setup is stripping the ID.

Temporary Fix / Workaround:

  1. Create a Custom HTML Tag in GTM.

  2. Paste your full tracking code (do not modify it).

  3. Set trigger to All Pages.

  4. Preview the page, open DevTools → Elements tab.

  5. Verify the data-tracking-id attribute is still present in the script tag.

    • If it’s missing → install the code manually in your site footer.


Step 3: Ensure Your Form Is Compatible

⚠️ External forms are not supported yet. The tracking script only recognizes and tracks internal forms embedded externally.


Step 4: View Submissions

In the CRM :

  1. Go to Sites → Forms → Submissions

  2. Filter by External Form Name

  3. Submissions appear with a tag:
     
    external form: {form_name}


Step 5: Workflow Triggers

You can automate actions based on:

  • Page View Trigger: Fires when a visitor views a page with the tracking script even if anonymous. Anonymous activity is stored and later attached to the contact when they submit an LC form.

  • Form Submission Trigger: Fires when a compatible form is submitted.

Available filters:

  • Domain

  • Page path

  • External form name

  • UTM parameters (Campaign, Source, Medium, etc.)


Advanced Troubleshooting

1. Enable Debug Mode

Add data-debug="true" to your script:

<script 
  src="https://link.yourdomain.com/js/external-tracking.js"
  data-tracking-id="tk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  data-debug="true">
</script>

Then open DevTools → Console and check for [LC Tracking] logs.

2. Network Checks

  • Look for successful 2xx responses.

  • Ensure no CORS errors appear.

  • Go to Application → Cookies

  • Confirm a session cookie is created.
     If missing → browser privacy or third-party restrictions might block it.

4. Common Issues

Problem

Fix

No console logs

Add data-debug="true and verify script placement

CORS errors

Check server CORS settings

Form not tracked

Confirm <form> tag and email input exist

Tracking ID missing

Ensure GTM hasn’t stripped attributes

SPA routing issues

Trigger manual page_view events after route change


Example Full Form

<form name="signup">
  <label>Email</label>
  <input type="email" name="email" required />
  <label>First Name</label>
  <input type="text" name="first_name" />
  <button type="submit">Submit</button>
</form>

Platform-Specific Installation

WordPress

  1. Copy tracking code.

  2. Go to Appearance → Theme Editor → Footer (or use Insert Headers and Footers plugin).

  3. Paste before </body> tag.

  4. Save changes.

Avoid page builders or plugins that replace forms with <div> widgets.

Important for WordPress users

Many WordPress page builders and plugins use non-form elements (such as <div> containers or JavaScript-based widgets) instead of real <form> tags.
Those forms are not compatible with the tracking script for submission tracking.

If your forms do not use real <form> tags:

  • Page view tracking will still work, but

  • Form submissions will not sync to your CRM.

To ensure compatibility:

  • Use plugins that output valid HTML forms (for example, WPForms, Gravity Forms, or Contact Form 7).

  • Confirm that the form includes <form> and <input type="email"> elements.

  • Avoid forms inside iframes or popups.


Wix

  1. Go to Settings → Advanced → Custom Code → + Add Custom Code

  2. Paste your script

  3. Set All Pages → Load code on each new page → Place in Body (end)

  4. Apply and publish.


Squarespace

  1. Go to Settings → Advanced → Code Injection

  2. Paste the script in the Header or Footer field

  3. Save and publish.


Shopify

  1. In Shopify Admin → Online Store → Themes → Edit Code

  2. Open theme.liquid

  3. Paste code before </body>

  4. Save.


HubSpot

  1. Go to Settings → Website → Pages → Templates or Site Footer HTML

  2. Paste your script before </body>

  3. Save and publish.


Drupal

  1. Go to Structure → Blocks → Add Block

  2. Paste your script into the block body

  3. Save.


Magento

Follow Magento’s Design Guide for adding third-party JavaScript in the Header or Footer HTML.


Joomla

  1. Go to Extensions → Templates → Templates → index.php

  2. Paste before </body>

  3. Save.


FAQs

Q: Can I see tracking activity inside contact records?
 Not unless a form is submitted and the contact is created.

Q: Why aren’t my external forms tracked?
 Currently, only Lead Connector embedded forms are supported for tracking.
 External custom or third-party forms aren’t captured yet.

Q: Does this handle analytics or attribution reporting?
 Yes tracked data appears in the Attribution Report, not in contact timelines or analytics dashboards.

Q: Can I use Google Tag Manager?
 You can, but only if the data-tracking-id attribute is preserved. Direct install is recommended.