Track calls to a phone number on a website

Use phone call conversion tracking to help you see how effectively your ads lead to phone calls from your website. When someone visits your website after clicking one of your ads, website call conversion tracking can help you identify and measure calls from your site.

This kind of conversion tracking tracks a call as a conversion when it lasts longer than a minimum length you set. This way, you can filter out shorter calls that probably don’t include sales or other valuable actions for your business.

You can use dynamically-generated Google forwarding numbers that replace your business number on your site, without any cost to you. As a result, you can see which specific keywords, ads, ad groups, and campaigns are leading to call conversions.

Tip: Phone Analytics and reporting is now available on Google Analytics. If you have a Google Analytics account, enabling website call conversions means you’ll be able to access reporting about calls made to your website. Phone Analytics metrics are available as one of the metric-group options in the Google Ads reports.

Before you begin

If you use another system to track when calls lead to sales or other conversions, you might want to create an import calls conversion action instead. Or, you can see all call conversion actions in the article about phone call conversion tracking.

Website call conversions only work if you have call extensions enabled. The phone number you set in your call extension is used to track calls from your website. Learn how to use call extensions

Here's what you'll need before you can set up conversion tracking for calls from a website:

  • A Google Ads account
  • An active call extension: You'll need at least one call extension. You can set this up before or after creating a call conversion action.
  • A business in an eligible country: Google forwarding numbers are currently available in these countries.
  • A website: This is where you'll put the conversion tracking code (called a "tag").
  • Ability to edit website: Either you or your web developer will need to be able to add the conversion tracking tag to your website, and add a JavaScript snippet to replace your business number with a Google forwarding number.

Instructions

There are 2 parts to setting up conversion tracking for calls to a Google forwarding number on your website.

1. Create a conversion action

  1. Sign in to your Google Ads account.
  2. In the upper right corner, click the tools icon , and under "Measurement," click Conversions.
  3. Click the plus button .
  4. Click Phone calls.
  5. Select Calls to a phone number on your website.
  6. Next to “Conversion name,” enter a name for the conversion you’d like to track. This will help you recognize this conversion action later in conversion reports. An example might be "Flower phone orders" or "Booking calls."
  7. Next to “Category,” select a description for your conversion action from the drop-down. The category allows you to segment your conversions in reports, so you can see similar conversions together.
  8. Next to “Value,” enter a value for each call, or select Don’t use a value if you'd prefer not to count one.
  9. Next to “Count,” select how to count these conversions.
    • One. This setting is best for leads, such as a sign-up form on your website, when only one conversion per ad click likely adds value for your business.
    • Every. This setting is best for sales, when every conversion likely adds value for your business.
  10. Click Call length. Enter the minimum length, in seconds, that a phone call needs to last to be counted as a conversion.
  11. Click on Click-through conversion window. Select a conversion window for this conversion action. The window can be 1 to 30 days.
  12. (Advanced) Click Include in "Conversions." Opting into this setting - selected by default - will include data for this conversion action in your "Conversions" reporting column. If you uncheck this setting, data will still be included in the "All conversions" column.
    • Data in the “Conversions” column is used by automated bid strategies like Target ROAS, Enhanced cost-per-click, or Target CPA. So, if you use an automated bid strategy to optimize for conversions, and you don’t want to include this particular conversion action in your bid strategy, you can uncheck this setting. Otherwise, leave it checked. Learn more about the "Include in 'Conversions'" setting
  13. Click Create and continue.

You’ll now see a screen with next steps to finish setting up conversion tracking.

2. Set up your conversion tracking tag

To set up conversion tracking for the first time, you'll need to add 2 code snippets to your website: the global site tag and a phone snippet.

The global site tag adds website visitors to your "All visitors" remarketing lists (if you've set up remarketing) and sets new cookies on your domain, which will store information about the ad click that brought someone to your site.

Note: Your Google Ads conversion tracking tag will be able to use this click information to attribute a conversion to your Google Ads campaigns. Ensure that you're providing users with clear and comprehensive information about data collection, and obtaining consent where legally required.

You must install the global site tag on every page of your website, but you need only one global site tag for each Google Ads account.

The phone snippet replaces a phone number on your website with a Google forwarding number. Install this snippet on site pages where your phone number appears.

  1. Under “Global site tag,” select the option that best describes your situation and follow the instructions for installing the tag:
    • The global site tag isn't installed on all your HTML pages: Choose this option if it’s your first time setting up the tag for a conversion action in your account and you haven’t installed the global site tag from another Google product. This option shows the full global site tag. To install the tag, copy the tag code and paste it between the <head></head> tags of every page of your website.

      Here’s an example of a global site tag, where “CONVERSION_ID” stands for the conversion ID that’s unique to your Google Ads account:

      <script async src="https://www.googletagmanager.com/gtag/js?id=AW-CONVERSION_ID"></script>
      <script>

      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'AW-CONVERSION_ID');

      </script>

    • The global site tag is already installed on all pages, but comes from another Google product (such as Google Analytics) or from another Google Ads account: If this option applies to you, you won’t need to add the global site tag to your website again; however, for conversion tracking to work for this account, you’ll need to add the config command (the piece of code that contains your conversion ID) to every instance of the global site tag. This option shows that command, where “AW-CONVERSION_ID” stands for your account’s conversion ID:

      gtag('config', 'AW-CONVERSION_ID');

      Add the config command to every instance of the global site tag on your website, right above the </script> end tag.

      Here’s an example of a global site tag that’s configured for both Google Analytics and Google Ads, with the config command for the Google Ads account highlighted:

      <script async src="https://www.googletagmanager.com/gtag/js?id=GA-_TRACKING_ID">
      </script>
      <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'GA_TRACKING_ID');
      gtag('config', 'AW-CONVERSION_ID');
      </script>

    • The global site tag was installed on my website when I created another conversion action in this Google Ads account: If this option applies to you, you don’t need to add the global site tag again to your website. Just make sure that the global site tag appears on every page of your site and that the config command in each instance of the tag contains your account’s conversion ID. You’ll see your conversion ID when you select this option.
  2. (Optional) Modify the global site tag based on your preferences:
    • If you don’t want the global site tag to add website visitors to your remarketing lists, add the highlighted portion below to your global site tag’s config command:
      gtag('config', 'AW-CONVERSION_ID', {'send_page_view': false});
    • If you don’t want the global site tag to set first-party cookies on your site’s domain, add the highlighted portion below to your global site tag’s config command:
      gtag('config', 'AW-CONVERSION_ID', {'conversion_linker': false});

      We don’t recommend doing this as it will lead to less accurate conversion measurement.

  3. Copy the global site tag, then follow the instructions to add it to your website.
  4. Next to “Phone snippet,” select one of the following options:
    • Enter your phone number as it appears on your website. Enter the phone number that you want to track calls to. Make sure to enter the exact digits that appear on your website. If the number on your website has a country code, include the country code here. If the number on your website does not have a country code, do not include the country code here. Then, click Create snippet.

      For instance, if you list the number on your website as 1-650-555-5555. You should enter the number as 1-650-555-5555. If you enter 650-555-5555, or 555-5555, Google Ads won’t be able to properly find your number and track your conversions. This option doesn’t work if you want to track multiple phone numbers on your website.

    • Don’t enter a number. You’ll need to edit your website code manually. If you select this option, you’ll need to follow the instructions below to edit your website code manually after you install your tag. This option is more advanced, and is recommended only if you’re comfortable using JavaScript. You should use this option if you want to track calls to multiple phone numbers on your website.
      Note: Only one number can be tracked on a single page using the default Javascript tag.
  5. Under “Install the phone snippet,” you’ll now see the code for the phone snippet based on the option you selected. Copy the snippet to add it to your website now, or click Download snippet to add it later.
  6. Open up the HTML for the page where the phone number appears on your website.
  7. Between the head tags (<head></head>) of the page, paste the phone snippet, right after the global site tag.
  8. Save the changes to your webpage.
  9. Click Next.
  10. Click Done.
Here are examples of HTML before and after adding the conversion tracking tag:
  • Sample HTML before conversion tracking code (sample only—don't use in your website's code).

    <html>
    <head>
    <title>Sample HTML File</title>
    </head>
    <body>

    This is the body of your web page.
    </body>
    </html>

  • Sample HTML after conversion tracking code (sample only—don't use in your website's code).

    <html>
    <head>
    <title>Sample HTML File</title>

    <!-- Global site tag (gtag.js) - Google Ads: AW-CONVERSION_ID -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=AW-CONVERSION_ID"></script>
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'AW-CONVERSION_ID');

    </script>

    <script>
    gtag('config', 'AW-CONVERSION_ID/CONVERSION_LABEL', {
    'phone_conversion_number': '1-650-555-5555'
    });
    </script>

    </head>
    <body>

    This is the body of your web page.
    </body>
    </html>

Track calls to the phone number on a website using Google Tag Manager

You can use Google Tag Manager to track calls to a phone number on your website by following these guidelines:

Set up your tag in Google Tag Manager

  1. Login to Google Tag Manager.
  2. Select any of the workspaces.
  3. Click on Tags.
  4. Click on New to create a new tag.
  5. Click on Tag Configuration. Scroll down to select ‘Google Ads Calls from Website Conversion’.
  6. Provide a phone number to replace
    Note: The phone number you enter needs to have the exact digits it has on your website.
  7. Provide the Conversion ID and Label from the Google Ads account.
  8. Provide or create a trigger which will fire when someone clicks on the phone number.
  9. Save the tag and publish the changes.

Note: The Google Tag Manager standard website call conversion tag is not compatible with international number formats. This can lead to Google Forwarding Numbers being displayed with plus “+" signs that are not intended to be there. To prevent incorrect plus signs from showing in the Google Tag Manager website call conversion tag, use the national format of the number, without the plus sign.

Edit website code manually to display a Google forwarding number

If you provided the phone number on your website while completing the steps above, you don’t need to follow the steps below. If you selected “Don’t enter a number,” you or your web developer now need to do the following:

Examples

  1. Open the HTML for the page where you added the phone snippet, that is, the page where your phone number appears. The phone snippet will look like the code sample below, where “CONVERSION_ID” stands for your conversion ID and “CONVERSION_LABEL” stands for your conversion label:

    <script>
    gtag('config', 'AW-CONVERSION_ID/CONVERSION_LABEL', {
    'phone_conversion_number': 'REPLACE WITH VALUE'
    });
    </script>

  2. For the phone_conversion_number parameter, replace “REPLACE WITH VALUE” with your business phone number. Make sure the number matches the number on your page exactly and including any relevant country codes.
  3. (Optional) Add the following optional parameters to your phone snippet. Follow these guidelines to enter values for the following parameters:
    1. phone_conversion_callback: Enter a callback function. This function will be invoked with 2 arguments. The first argument is the formatted telephone number (in the same format as the phone_conversion_number parameter) The second argument is the telephone number in a plain format (Example: '18001234567').
    2. phone_conversion_css_class: Enter a CSS class name. All elements of that class will have their contents replaced with a formatted telephone number.
    3. phone_conversion_options: You can enter one of the following values:
      • timeout: Maximum time in milliseconds that is allowed for retrieving a number. If a number cannot be fetched within this time, no number is sent to the target. The default timeout is 5000 milliseconds.
      • cache: Set to false to disable caching of the retrieved number in a cookie; otherwise, set the value to true.

    Example of phone snippet with optional parameters

    <script>
    gtag('config', 'AW-CONVERSION_ID/CONVERSION_LABEL', {
    'phone_conversion_number': '1-650-555-5555',
    'phone_conversion_callback': function(formatted_number, mobile_number) {
    // formatted_number: number to display, in the same format as the
    // number passed to 'phone_conversion_number'.
    // (in this case, '1-650-555-5555')
    // mobile_number: number formatted for use in a clickable link
    // with tel:-URI (in this case, '+16505555555')
    var e = document.getElementById("number");
    e.innerHTML = "";
    e.appendChild(document.createTextNode(formatted_number));
    },
    'phone_conversion_options': {
    'timeout': 20,
    'cache': false
    }
    });
    </script>
  4. Save the changes to your webpage.

The examples below show how to implement this code snippet in 3 different use cases.

Example 1: Replace your static phone number with a Google forwarding number

This function gets a telephone number and replaces the contents of all spans of the given class. In this example, the phone number "1-800-123-4567" inside the span tag will be replaced with the dynamically generated, formatted forwarding number.

  1. Add the phone_conversion_css_class parameter with the value number to your phone snippet. This line is highlighted in the example below:

    <script type="text/javascript">
    gtag('config', 'AW-CONVERSION_ID/CONVERSION_LABEL', {
    'phone_conversion_number': '1-800-123-4567',
    'phone_conversion_css_class':'number'
    });
    </script>

  2. In the HTML for the webpage that has your phone number(s), add the class from the phone_conversion_css_class parameter (highlighted in the example below) to the span tag that contains your phone number.
    <body>
    <span class="number">1-800-123-4567</span>
    </body>

Example 2: Pass the Google forwarding number to a custom callback function

Gets a telephone number and sends it to a callback function. The example callback function will replace contents of an element with the id "number" with the formatted forwarding number.

  1. Update your phone snippet to match the code sample below. Replace “1-800-123-4567” with the phone number that appears on your website. Also, make sure to replace “CONVERSION_ID” with the conversion ID unique to your Google Ads account, and replace “CONVERSION_LABEL” with the conversion label unique to the conversion action.

    <script type="text/javascript">
    var callback = function(formatted_number, mobile_number) {
    // formatted_number: number to display, in the same format as
    // 'phone_conversion_number'.
    // (in this case, '1-800-123-4567')
    // mobile_number: number formatted for use in a clickable link
    // with tel:-URI (in this case, '+18001234567')
    var e = document.getElementById("number");
    e.innerHTML = "";
    e.appendChild(document.createTextNode(formatted_number));
    };

    gtag('config', 'AW-CONVERSION_ID/CONVERSION_LABEL', {
    'phone_conversion_number': '1-800-123-4567',
    'phone_conversion_callback': callback
    });
    </script>

  2. In the HTML for the webpage that has your phone number(s), add the id parametewith the value number (highlighted in the example below) to the span tag that contains your phone number.
    <body>
    <span id="number">1-800-123-4567</span>
    </body>

To allow people viewing your website on a mobile phone to call your business easily, you can make the Google forwarding number clickable.

Example 3: Pass the Google forwarding number to a custom callback function on your mobile site
On mobile web pages with a clickable phone number, replace both the number that is displayed and the number that is called when clicked. This requires use of the callback function.

  1. Update your phone snippet to match the code sample below. Replace “1-800-123-4567” with the phone number that appears on your website. Also, make sure to replace “CONVERSION_ID” with the conversion ID unique to your Google Ads account, and replace “CONVERSION_LABEL” with the conversion label unique to the conversion action.
    <script type="text/javascript">
    var callback = function(formatted_number, mobile_number) {
    // formatted_number: number to display,in the same format as
    // 'phone_conversion_number'.
    // (in this case, '1-800-123-4567')
    // mobile_number: number formatted for use in a clickable link
    // with tel:-URI (in this case, '+18001234567')
    var e = document.getElementById("number");
    e.href = "tel:" + mobile_number;
    e.innerHTML = "";
    e.appendChild(document.createTextNode(formatted_number));
    };
    gtag('config', 'AW-CONVERSION_ID/CONVERSION_LABEL', {
    'phone_conversion_number': '1-800-123-4567',
    'phone_conversion_callback': callback
    });
    </script>
  2. In the HTML for the webpage that has your phone number(s), add the id attribute with the value number (highlighted in the example below) to the <a> tag that contains your phone number.
    <body>
    <a href="tel:18001234567" id="number">1-800-123-4567</a>
    </body>

Checking your code

It can take up to an hour for your ads to be enabled for this conversion action. If you'd like to make sure it's working, you can do a search that brings up your ad, then click the ad to visit your website (you'll be charged for the click). Your regular phone number should now be replaced with a Google forwarding number.

If you're doing repeated tests, delete the "gwcc" cookie from your browser before clicking on an ad again.

Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue