Overview
The Pingtree Click Script is a JavaScript tracking script that powers client-side tracking on your landing pages. When installed, it automatically generates a unique Transaction ID for each visitor, tracks click and form events, captures lead data fields, and handles consent token collection — all in real time. The Click Script is the bridge between your landing page and the Pingtree platform. Every lead that flows through the system starts with a Transaction ID generated by this script.What the Click Script Does
When a visitor lands on a page with the Click Script installed, the script:- Generates a Transaction ID — A unique UUID (v4) is created and stored in the visitor’s browser cookie for the configured cookie duration.
- Fires a click event — The script calls the Pingtree click API to register the visitor as a click lead, capturing browser, device, and geolocation data.
- Tracks page interactions — As the visitor progresses through the form, the script tracks field completions and form submission events.
- Captures custom parameters — Any query string parameters on the landing page URL (UTM params, sub IDs, etc.) are automatically captured and attached to the lead record.
- Handles consent tokens — If Jornaya or TrustedForm integrations are enabled, the script retrieves and stores consent tokens alongside the lead.
Script Installation
Add the Pingtree script tag to the<head> of your landing page HTML. The script is campaign-specific and is served dynamically based on the campaign ID (cid).
Standard Tracking Script
{cid} with your campaign’s unique ID (visible in your campaign settings).
Consent Script Variant
For pages that display TCPA consent language managed through Pingtree, use the consent script instead:
Tip: Place the script tag as early as possible in the <head> section to ensure the Transaction ID is generated before any form interactions occur.
Script URL Reference
| Script | URL Format | Purpose |
|---|---|---|
| Main Tracking Script | /sdk/{cid}/pingtree.js | Click tracking, Transaction ID generation, form event capture |
| Consent Script | /sdk/{cid}/pingtree-consent.js | Consent language display and TCPA token retrieval |
| Consent Language API | /sdk/get-consent/{cid}/{transaction_id}/{fvid} | Retrieves dynamically populated consent language for a specific lead session |
What the Script Captures
The script collects and transmits the following data at the time of the click event:Visitor & Device Data
- Browser name and version
- Operating system
- User agent string
- IP address
- Geolocation data (city, state, ZIP code, country) — when geo lookup is enabled for the campaign
URL Parameters
All query string parameters present on the landing page URL are captured, including:pid— Publisher / Source IDsub1throughsub5— Sub-source identifiersgclid,fbclid,ttclid— Ad network click IDs- UTM parameters and any custom parameters configured on the source
Consent Tokens
When consent integrations are enabled on the campaign:- Jornaya: LeadID token captured from the Jornaya script
- TrustedForm: Certificate URL captured from the TrustedForm script
Cookie Storage
The Transaction ID is stored in the visitor’s browser cookie so it persists across page navigations within the same session. The cookie duration is configured at the campaign level:| Setting | Description |
|---|---|
| Cookie Duration | How long the Transaction ID cookie is valid (e.g., 24h, 7d, or a custom value) |
| Default | 24 hours if no custom duration is configured |
Script Behavior & Configuration
The script’s behavior is controlled entirely by the campaign settings configured in Pingtree. No manual code changes are required after installation. Configuration includes:- Ad network integrations: Google Ads, TikTok Ads, Facebook (Meta) — enabled in Campaign Settings > Click Script
- Consent integrations: Jornaya, TrustedForm — enabled per campaign
- Sub-parameters: Custom query parameters passed through and attached to the lead
- Custom fields: Additional data fields captured from the page and appended to the lead record
Event Tracking
The script fires events back to Pingtree at key points in the visitor journey:| Event | When It Fires |
|---|---|
| Base Click Event | Immediately on page load — registers the visitor as a click lead |
| Form Submission Event | When the visitor submits the lead form |
| Custom Events | At any point configured via the Event Manager in campaign settings |
Billing Requirement
The Click Script API (/sdk/click) enforces an active billing check before processing requests. If the organization’s account has an unpaid balance or billing is not active, the script will not generate Transaction IDs and click events will be rejected.
Ensure your organization’s billing is up to date in Settings > Payment Methods to avoid interruptions to click tracking.
Rate Limiting
Click API requests are subject to the rate limits configured for your organization. If the rate limit is exceeded, requests are rejected with an HTTP429 Too Many Requests response. Contact your platform administrator to adjust rate limits if needed.