在一个网站上使用多个 Google Adwords 呼叫跟踪号码需要什么?

What is required to use more than one Google Adwords call tracking number on a website?

我一直在尝试设置转化跟踪以使用 Google Adwords 免费电话跟踪号码,但客户有多个业务地点,每个地点都有自己的 phone 号码。所以我们需要替换不同的数字,具体取决于从广告访问的页面。

最重要的是,这些号码也是 href="tel:" 点击呼叫号码,并出现在页面的多个位置。

关于是否可以在不同页面上替换不同数字,似乎有很多相互矛盾的建议。在这种情况下需要采取哪些步骤来实施跟踪号?

注意:这并不是指将同一页面上的不同号码替换为不同的跟踪号码。这个建议似乎很普遍,无法完成。

好吧,经过多方测试和咬牙切齿,是可以实现的,而且(相对)简单。我将解释我是如何使用 Google 跟踪代码管理器 (GTM) 将代码添加到页面的。我欢迎就如何更优雅地完成此操作提出想法和反馈...

  • 首先,您需要在 Phone 中创建一个新的来电转化事件 工具-> 转化下的 Adwords。
  • 选择 "Calls to a phone number on your website",进行设置,但在标签选项下选择 "Don't enter a number. You'll need to edit your website code manually"。
  • 复制转化跟踪代码,将其放入 GTM 的代码中并将其设置为 在特定页面的页面视图上触发。
  • 接下来创建一个 GTM 代码并输入根据所示代码修改的代码 here:

.

<script type="text/javascript" id="adwords_google_forwarding_num">
; (function() {
    var originalNumber = 'xx xxxx xxxx'; // replace with number to be tracked
    function callback(formattedNumber, mobileNumber) {
      var phoneElement = document.querySelectorAll('.number_link'); //replace with whatever selector you're using to using
      if (phoneElement) {
        for(i=0;i<phoneElement.length;i++){
          phoneElement[i].href = "tel:" + mobileNumber;
          phoneElement[i].innerHTML = "";
          phoneElement[i].appendChild(document.createTextNode(formattedNumber));
        }
      }
    };
    _googWcmGet(callback, originalNumber);
  })();
</script>
  • 这将处理号码的多个实例和点击呼叫方面。在 DOM 加载特定页面时在 GTM 中触发此标记。
  • 通过点击广告进行测试。使用 #google-wcc-debug 的非常有用的建议描述 here,仅当您至少点击一次广告时才有效。
  • 最后,在测试不同页面时,使用隐身或清除缓存。听起来很明显但很容易被忽视,并且一旦为一页调用了一个数字,它就不会替换其他页面上的数字。调试消息将显示类似 "Advertiser number doesn't match previous call:".
  • 的内容
  • 区号是否加括号似乎无关紧要。不确定其他特殊字符...