Ads call tracking
Show each website visitor who came from a Google Ads or Meta Ads click a phone number from a pool, credit the call to the campaign, keyword and ad.
Open Admin > Settings > Integrations > Ads call tracking (/admin/ad-tracking). You need integrations:read to see it and integrations:write to change it. The report needs reports:read.
Set up a pool
- Under Number pools, press Add pool. A pool belongs to one campaign or site. Set:
- Name and Platform (Google Ads, Meta Ads or any platform).
- Fallback number (when the pool is full), in E.164 format.
- Session length (seconds): how long a visitor keeps a number, 60 to 86400, default 1800.
- Grace after the session (seconds): how long a number stays reserved so a late call is still credited, 0 to 86400, default 300.
- Pool switched on.
- Under Numbers, press Add number and enter each DID, for example
+525510000001. A number belongs to one pool. - Copy the Website snippet into your site:
<script async src="https://<your PBX>/api/v1/ad-tracking/public/<site_key>/snippet.js"
data-default-number="+525510000000"></script>
data-default-number is the number the page shows now. The snippet replaces it in tel: links and in text, and in any element marked data-mpbx-number, with the visitor's pool number.
How numbers are assigned
- Only a visit whose address carries an ad click id (
gclid,gbraid,wbraid,fbclid) or campaign parameters (utm_campaign,utm_termas the keyword,utm_contentas the ad,utm_adgrouporadset,utm_source) gets a pool number. Other visitors keep the page's number, so crawlers cannot drain the pool. - A visitor keeps the same number while the visit lasts. A number is never given to a second visitor while it is held.
- When the pool is full, the fallback number is shown and calls to it are not attributed.
Report
Calls by campaign, keyword and ad groups tracked calls with Group by Campaign, Campaign and keyword, or Campaign and ad. Columns: calls, answered, talk time (seconds). Calls without attribution fall under the campaign (direct). The same data is at GET /api/v1/reports/ad-tracking?by=campaign|keyword|ad&from=&until=.
Record calls through the API
A finished call is attributed with POST /api/v1/ad-tracking/calls (call id, dialled number, caller, start time, answered and talk seconds). The call is matched to the visit that held the dialled number at that time.
Good to know
- The public session route has no per-address rate limit. A script that adds
?gclid=...can hold the numbers of a pool until the visits expire.