Dynamic number replacement
Show every visitor the virtual number of the source they came from – Google, Facebook, TikTok – and know exactly which campaign brought each call.
How it works
- The script replaces the number in the site’s text, in
tel:andsms:links and, when enabled, in WhatsApp links. - The source is determined by a URL parameter (e.g.
utm_source). If the parameter value is itself a phone number, it is displayed directly. - The chosen number is kept for the whole visit, across pages.
- Content loaded later (popups, forms) is replaced too.
- Numbers inside
input,textarea,selectand elements withdata-no-replaceare never replaced.
Code generator
Options
| data-* | URL | GTM | Description |
|---|---|---|---|
data-old-number required | old | oldNumber | The number currently shown on the site, to be replaced. |
data-new-number | new | newNumber | The default number to display. Required unless numbers per source are set. |
data-utm-param | utm | utmParam | URL parameters that determine the source, comma-separated. E.g. utm_source,source. |
data-source-map | sources | sourceMap | source:number pairs, comma-separated. E.g. google:051-1111111,facebook:052-2222222. |
data-whatsapp | whatsapp | whatsapp | yes – also replace in WhatsApp links (auto-converts to the 972 prefix). Default: no. |
data-exclude | exclude | exclude | Selectors of elements to skip, comma-separated. |
Three ways to embed
- data-* – for most websites.
- Script URL parameters – for plugins that strip data attributes.
- GTM – configure via
window.ExsilePhoneConfigbefore the script loads.