Skip to main content
InvocaJS is the JavaScript library behind the Invoca Tag — it captures visitor attribution, swaps in a trackable phone number, and ties that data to the call when it happens.
Invoca bridges the gap between a visitor’s digital experience and the phone call that follows it. The InvocaJS library — the technology behind the Invoca Tag — is the cornerstone of how this works.

How InvocaJS works

InvocaJS runs on your website and collects attribution details about a visit: the page being viewed, and how the visitor got there. It also collects integration details such as a Google Client ID, Adobe User ID, or a custom session ID — data points that serve as primary identifiers in third-party systems of record. InvocaJS then requests or updates a phone number from Invoca’s servers and dynamically swaps out numbers already on the page. When a visitor calls, all of that attribution data is captured and tied to the call. This happens on page load, driven by a small snippet of configuration code.

Configuring InvocaJS

The Invoca Tag and Tag Wizard provide a UI-driven workflow for configuring and deploying InvocaJS, instead of writing JavaScript configuration directly into your landing pages or tag manager. Any account still using the manual JavaScript configuration remains fully supported — InvocaJS stays backwards compatible, and features built for the Tag Wizard are also available to accounts using manual configuration.

Reliability and testing

InvocaJS is covered by automated tests using the Jasmine test framework, with new features and fixes built using Test Driven Development to keep test coverage consistent. This is supported by local test environments, automated integration tests, and a continuous deployment pipeline.

Number detection and mobile support

InvocaJS doesn’t require you to specify the exact format of every number on your page — number detection and swapping logic account for formatting variations (hyphens vs. periods, for example), vanity numbers, and international numbers. Mobile support includes detecting and swapping tel: links (tap-to-call links or buttons), even when a phone number isn’t visibly displayed on the page. Google AMP pages are also fully supported.

Single Page Application support

Websites built with frameworks like React or Angular (“Single Page Applications,” or SPAs) load new views without a full browser page reload, so a “page ready” event doesn’t fire on every view change. InvocaJS can hook into a framework’s render system and re-run its logic after view content changes, so numbers matching your configuration are swapped even if they render later in the page’s lifecycle.

Logging

InvocaJS logging is designed to help you self-serve most issues that arise during integration and testing, with clear debug output rather than confusing or redundant messages.

Where to go next

Last modified on September 21, 2026