Google Call Conversions and Buttons (your doc out of sync?)

  • 3 April 2018
  • 4 replies
  • 12 views

I would like to refer to your document about using Google Call Conversions with Unbounce. Your docs seem out of sync with the code they refer to a bit. I linked to the document below.

I am specifically trying to use Google Call Conversions with BUTTONs.

The code example has the following:

// Add the button ID’s to this array that you want tracked
// For example: [’#lp-pom-button-12’, ‘#lp-pom-button-20’]
var callButtons = [];

but the document says this:

Find “callButtons” at the top of the script you just added and replace ‘#lp-pom-button-12’ with the ID of the button you want to integrate with the call forwarding feature.

I interpreted that as follows, changing the code to this for my two call buttons… so my code is as follows (referring to my buttons IDs)

var callButtons = [’#lp-pom-button-12’,’#lp-pom-button-99’];

…but it does not work - the buttons are not clickable for calling, let alone trackable as conversions.

Please help! Are you out there @Stefano? Did you solve this @Kitx 🙂

here’s the link to the doc:
https://documentation.unbounce.com/hc/en-us/articles/203509834-Using-Google-s-Website-Call-Conversion-Feature.


4 replies

Userlevel 7
Badge +4

Hey Scott!

What kind of buttons are you using? Here is an example of my script…

<script>
  // NOTE: If you want to track these links as conversion goals on Unbounce,
  // change 'clkn' to 'clkg' in the commented areas below
  
  // Add the button ID's to this array that you want tracked
  // For example: ['#lp-pom-button-12', '#lp-pom-button-20']
   var callButtons = ['#lp-pom-button-108', '#lp-pom-button-9', '#lp-pom-button-184', '#lp-pom-button-192'];
  
  var ubCallback = function(formatted_number, unformatted_number) {
    var numberLinks = document.getElementsByClassName('number_link');
    var numberTexts = document.getElementsByClassName('number_text');
    
    // Clickable text number Links
    $(numberLinks).each(function(i, numberLink) {
      // Change clkn to clkg if you are tracking your links as Unbounce conversion goals
      numberLink.href = "clkn/tel/" + unformatted_number;
      numberLink.innerHTML = "";
      numberLink.appendChild(document.createTextNode(formatted_number));
    });
    
    // Non-clickable text
    $(numberTexts).each(function(i, numberText) {
      numberText.innerHTML = "";
      numberText.appendChild(document.createTextNode(formatted_number));
    });
    
    // Button numbers
    $(callButtons).each(function(i, callButton) {
      // Change clkn to clkg if you are tracking your links as Unbounce conversion goals
      $(callButton).attr("href", "clkn/tel/" + unformatted_number);
      $(callButton + " span").text(formatted_number);
    });
  };
</script>

<script>
  $(function(){
  _googWcmGet(ubCallback, '514-461-3631')
  });
</script> 

Our scripts, and deployment, look identical … it is so helpful that you messaged me.

Userlevel 7
Badge +4

My pleasure!

I am always here when you need me 🦇🔦

Cheers 🙂

Userlevel 7
Badge +4

We have this script working on desktop but not on mobile. Any idea what could be causing it not to work on mobile?

Reply