Setting up _googWcmGet for AdWords Call Tracking Conversions

Please, help,

I am trying to set up a tracking code to track Google AdWords from a website. I created the code provided by Google and now they are asking me to create the following:

"Create a code snippet to replace the phone number with the google redirect number using the _googWcmGet function. The function has the following parameters: _googWcmGet (target, business_number, options)"

I'm not sure where to place this and how to get it to work. I have tried many options, please help.

I am working from https://support.google.com/adwords/answer/1722054?hl=en&ref_topic=3165803

+3


source to share


3 answers


Take a look at https://support.google.com/adwords/answer/1722054?hl=en ("Track Calls From Website"), in the example below they will just name it using the onload attribute of the body tag, like so:

<body onload="_googWcmGet('number', '1-800-123-4567')">
  <span class="number">1-800-123-4567</span>
</body>

      

It just replaces all class number intervals with tracking number. The first parameter ("number" in this case) is the class name of your element.



If your element does not have a class, you need to provide a custom callback function as the first parameter. This example assumes that your element has the id "number", but of course you can use all JavaScript features to identify dom elements:

<head> 
  <script type="text/javascript">
    var callback = function(formatted_number, unformatted_number ) {
      // formatted_number: number to display, in same formatting as number
      //        passed to _googWcmGet(). e.g '1-800-444-5555' in this case
      // unformatted_number: number to display without any formatting. e.g.
      //        '18004445555' 
      var e = document.getElementById("number");
      e.innerHTML = ""
      e.appendChild(document.createTextNode(formatted_number));
    };
 </script>
</head>
<body onload="_googWcmGet(callback, '1-800-123-4567')">
  <span id="number">1-800-123-4567</span>
</body>

      

+4


source


One useful addition here: there is a hidden debugging tool that the Google dev team provides when #google-wcc-debug

added to a URL.



Just add a hash to the url where you want to test it, hit enter and then refresh the page. At the bottom of the page, a dialog box appears with a FORCE button in the upper right corner. Pressing this button will swap the phone number with 99999999, which is very useful for testing.

+2


source


In the first example:

<body onload="_googWcmGet('number', '1-800-123-4567')">
  <span class="number">1-800-123-4567</span>
</body>

      

Can the number be formatted like (for example, discarding "1 -"):

<body onload="_googWcmGet('number', '800-123-4567')">
  <span class="number">800-123-4567</span>
</body>

      

+1


source







All Articles