Swap Phone Numbers Dynamically Depending on the Traffic Source
Display a phone number automatically using trackdrive.js or trackdrive.php to track traffic sources, URL keywords, and custom tokens.
Usage Instructions
1. Include the trackdrive optimizer library on your page.
<script src="https://trackdrive-assets.s3.amazonaws.com/assets/trackdrive-optimizer.js
"></script>
2. Put some numbers on your page
<h1>(855) 654 2938</h1>
<p>Click this number to call now: <a href="tel:+18556542938">+18556542938</a></p>
3. Call the library with your optimizer token.
Your token can be obtained from one of your offers: https://trackdrive.com/offers
var options = {
// Your token from https://trackdrive.com/offers
offer_token: 'xyz'
};
// Each occurrence of (855) 654 2938 and +18556542938 on your HTML page will be replaced with a Trackdrive tracking number.
Trackdrive.Optimizer.replace_all(options, [
['(855) 654 2938', 'human_number'],
['+18556542938', 'plain_number']
]);
1. Download the trackdrive.php library.
2. Require the library on your website:
<?php require('trackdrive.php'); ?>
3. Display a number:
<?php show_trackdrive_number('8519320582390jf9082j9032'); ?>
This feature, like all other TrackDrive features, is easy to install and quick to set up. Here's a brief overview on how dynamic number replacement works:
- Install a one-line snippet of JavaScript on your website.
- Create TrackDrive tracking numbers to track visitors from specific sources (for example, Google AdWords)
- When a visitor arrives on your website, TrackDrive's JavaScript detects their source and swaps their phone number automatically so you can track which sources are sending you phone calls.