Skip to content

Tracking script reference

What the tracking script is, what it needs from a website, and what it collects. For installation steps, see Install the tracking script.

The tag

<script async src="https://ctjs.au/ct.js?code=YOUR_TRACKING_CODE"></script>
Attribute Required Description
src Yes https://ctjs.au/ct.js?code= followed by the tracking site's code, which starts with E-. Without the code the script does nothing. There is no versioned URL; Enfonica updates the script in place.
async Recommended Lets the browser render the page while the script loads.

The script has no other customer configuration. Which numbers to swap, and how to format them, come from the tracking site's pool rules.

Size and delivery

About 30 KB compressed. Browsers cache it briefly, so updates reach visitors without any change on the website.

Browser requirements

Current versions of Chrome, Edge, Firefox and Safari, and Safari 15.4 or later on iOS. In older browsers the script does nothing and the page keeps its original number.

Requests

The script talks only to https://ctjs.au: once when a page loads, again when the URL changes on a single-page website, and periodically while the visitor is active so the assigned number stays with them.

URL parameters captured

utm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_id, utm_source_platform, utm_creative_format, utm_marketing_tactic, gclid, gbraid, wbraid, dclid, fbclid, msclkid, ttclid, li_fat_id and twclid. Call Tracking keeps the values from the landing page for the session.

Browser storage

The script keeps two values in both session storage and local storage: enfonica_session_id, a random session identifier, and enfonica_last_active, the time of the visitor's last activity. They let a visit be recognised across pages and tabs until 30 minutes pass without activity, after which the next page view starts a new session. The local storage values stay until the browser's site data is cleared. The script doesn't set cookies. If storage is unavailable, each page load starts a new session.

Number matching

The script matches the rule's number in page text and in tel: links, in any usual Australian format, and replaces it with the assigned tracking number: in the rule's display format in the text, and in E.164 in a tel: link's href. Numbers split across elements, inside images or inside other attributes aren't matched. See Where the number can be.

Single-page applications

The script detects URL changes and swaps numbers on the new view. See Single-page applications.

Console output

All messages are prefixed [EnfonicaTracker]. For what each message means and what to do, see The tracking script shows an error in the browser console in the Help Center.

Content Security Policy

script-src https://ctjs.au; connect-src https://ctjs.au;

No inline scripts, eval, iframes or images are used. The script sets no cookies; it reads the Google Analytics _ga and _ga_* cookies if they are present.

Privacy

See What the tracking script collects.