Guides / Install the tracking tag

Install the tracking tag

Add Saylia's tracking tag to your website so each visitor sees a tracking number and every call is tied to the ad, keyword and page behind it. How it works, what it records, single-page apps and troubleshooting.

Last updated Getting started

The tracking tag shows each website visitor a tracking number in place of your own, and remembers where that visitor came from. When they call, Saylia knows the ad, campaign, keyword and landing page behind the call, and the click ID it needs to report the outcome to your ad platforms.

Install it

  1. In Saylia, open Install and copy your tag. It’s the same tag for every website your account owns, so you can paste it on all of them.
  2. Paste it into the <head> of every page that shows your phone number. If your site builder has a “header code” setting, that’s the place.
  3. Visit your site. Your domain appears under Install as a site running the tag, waiting for approval. Approve it.
  4. Make sure a tracking number or number pool is set up to serve that site. Until one is, the tag leaves your page alone. Once numbers serve the site, visitors none of them match see your fallback number, if you’ve set one.

The tag has two parts: a hint that lets the browser open its connection to Saylia early, and the script itself, which loads without holding up your page.

<!-- Saylia tracking tag: copy yours from Install in the app -->
<link rel="preconnect" href="https://…" crossorigin>
<script …></script>

Approve your domains

The tag only swaps numbers on domains you’ve approved. That stops a copied page, or a tag pasted onto the wrong site, from showing your numbers somewhere you don’t control.

  • The tag reports where it’s running. A domain that loads your tag but isn’t approved yet shows up under Install, one click from approval. It’s never silently ignored.
  • Subdomains are included by default. Approving example.com also covers www.example.com and offers.example.com. Turn that off for a domain when something under it shouldn’t swap, such as a customer login or a partner’s app.
  • Approval never climbs. Approving offers.example.com doesn’t cover example.com or its other subdomains.
  • Shared hosting domains are approved one site at a time. You can approve yoursite.vercel.app, but not everything under vercel.app, because those subdomains belong to other people.

What your visitors see

  • Your number, swapped for a tracking number, in the same format. (512) 555-0100 stays in brackets; 512.555.0100 stays dotted. The tag matches numbers by their digits, so (512) 555-0100, 512-555-0100, 512.555.0100 and +1 512 555 0100 are all found. It works with US and Canadian numbers written in one piece of text.
  • Click-to-call links are updated too. tel: links that dial your number dial the tracking number instead.
  • The same number for the whole visit. A visitor keeps their number as they move between pages, and on every page after the first it’s usually shown with no visible flicker.
  • Your real number for search engines. Crawlers that identify themselves are never shown a tracking number, so search engines and directories keep seeing your own.
  • Your own number if anything goes wrong. If the tag can’t reach Saylia in time, the page keeps the numbers it already had. Visitors can always call you.

How numbers are held and reused

When the tag gives a visitor a number from a pool, the number is held for them while they browse. Each pool has three settings, with these defaults:

Setting Default What it means
Visit length 30 minutes How long a visitor keeps their number after they stop browsing. An open page keeps it for as long as it’s open.
Reuse delay 5 minutes How long the number rests before it can go to someone else.
Callback window 72 hours How long a call to that number is still credited to the last visitor who held it, for people who call back later from their phone’s history.

If every number in a pool is in use, the visitor sees the pool’s overflow number. It rings and records like any other; the call just isn’t tied to one particular visitor. Saylia recommends a pool size from your typical busy hour, so overflow stays rare.

Traffic that looks automated, or comes from data-center networks rather than people, gets the overflow number too. That keeps pool numbers free for real visitors.

What the tag records

For each visit, the tag records what Saylia needs to credit a call:

  • the landing page URL and the referring page, kept with only their campaign parameters: the UTM tags, click IDs and any parameters you choose. Other query parameters are also saved as separate fields unless the number pool has a parameter list, so set one if your links can carry personal details like an email address.
  • UTM parameters: utm_source, utm_medium, utm_campaign, utm_term and utm_content
  • ad click IDs: gclid, gbraid and wbraid (Google), msclkid (Microsoft) and fbclid (Meta)
  • your Google Analytics client ID, if Google Analytics is on the page
  • the device type
  • up to 25 other URL parameters, such as ?promo=spring, so routing rules and reports can use them

Set window._ctParams before the tag loads to pass values of your own. They’re recorded the same way as URL parameters, and win if both use the same name:

<script>
  window._ctParams = { location: 'north-austin' };
</script>

Single-page apps

The tag watches the page for changes and swaps numbers that appear later, such as a number rendered after a route change or inside a modal. You don’t need to do anything for most sites.

If you want to re-apply the swap at a particular moment, for example straight after your router changes page, call:

window.CallTracking?.run();

It re-applies the visitor’s current numbers, and starts a visit only if there isn’t one yet.

Check it’s working

  1. Open your site in a private browser window. The phone number should change to a tracking number within a moment of the page loading.
  2. In Saylia, open Install. Your domain shows as approved, with when the tag was last seen on it.
  3. Place a test call to the number you were shown. It appears in Saylia with your visit’s source and landing page.

Troubleshooting

The number doesn’t change.

  • Check Install: is the domain approved, or waiting for approval?
  • Is a tracking number or pool set up to serve that site?
  • Does the number on the page match the number Saylia is set to replace? The formatting can differ, but the digits must be the same.

Some numbers change and others don’t. The tag replaces numbers written as text and in tel: links. It can’t change a number inside an image, and it doesn’t reach into embedded frames from other sites, such as a booking widget.

Everyone gets the same number. That’s the overflow number. Either the pool is too small for your traffic, and Saylia’s pool size recommendation will say so, or the visits are coming from data-center networks, as happens with some testing tools and cloud desktops.

Calls show no source. The caller may have dialed a number from your site before the tag was installed, or called a number that isn’t served by the tag, such as one printed on a flyer. Those calls are tracked by their number instead.