This package offers a simple way to install the plumbing for Adwords call tracking. No more fussing about with hacky, one-off install scripts to make call tracking work.
For all phone numbers on a page that you would like tracked, structure your
HTML with the relevant
<a href="tel:1-800-REAL" class="phone-number--link"> <span class="phone-number--text"> <span>1-800-REAL</span> </span> </a>
First, make sure to include
<!-- Global site tag (gtag.js) - Google Ads: AW-CONVERSION_ID --> <script async src="https://www.googletagmanager.com/gtag/js?id=AW-CONVERSION_ID">
import * as AdwordsPhoneTag from "@adhawk/adwords-phone-tag"; const conversionId = "AW-111111111"; // replace with your own conversion id const conversionLabel = "xxxxxx--xxxxxxxxxxx"; // replace with your own conversion label AdwordsPhoneTag.install(conversionId, conversionLabel);
Now, when a visitor comes from an AdWords campaign, the phone number will be replaced so conversions will be properly tracked.