Implementing Google Ads Call Tracking Conversion

Tealium Expert
Tealium Expert

Hi All

So i am looking at implemeting the google ads call tracking, which is not native to the current conversion adn remarketing tag. 

The code for this uses a call back function to fetch on a gtag api call, which receives a forwarding number then uses an element id to replace the number on site. 

<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>

Besides a DOM insjection (which i suspect won't work, due to the global tag potentially not having been called). Are there any other ideas as to the best way to do this?

thanks


Gavin

 

Research your Experience | Improve and Evolve | Leave no one behind
- Don't forget to mark a solution as accepted if it hits the mark -
5 REPLIES 5

Implementing Google Ads Call Tracking Conversion

Tealium Expert
Tealium Expert

Hi @GavinAttard

That should work fine if you put that code in a JS extension scoped to either After Tags or DOM Ready.

That scoping should ensure the gtag code is available.

Implementing Google Ads Call Tracking Conversion

Gold Contributor
Gold Contributor

Hi @GavinAttard,

You can add a Tealium custom container tag. In the tag template place the exact code where it says "start tag sendind code" and publish. Then You are all set.

VR

Implementing Google Ads Call Tracking Conversion

Gold Contributor
Gold Contributor

@GavinAttard -- Curious if you got this working?

We're attempting to impliment the same functionality and are running into issues.

Curious if you migh be able to provide any nuggets of truth?

Implementing Google Ads Call Tracking Conversion

Tealium Expert
Tealium Expert

Hi

Apologies dor the ridiculous delay in reply, i completly missed this. 

At the time i hadn't had the time to implement this, however happy to help get it setup if you are still having difficulties. 

We can setup a call anytime. 

Gavin 

Research your Experience | Improve and Evolve | Leave no one behind
- Don't forget to mark a solution as accepted if it hits the mark -

Implementing Google Ads Call Tracking Conversion

Gold Contributor
Gold Contributor

Hi @GavinAttard. I'm just now seeing you replied. And as luck would have it, we're back to attempting to implement this solution. Any nuggets of truth you can provide would be apricated.

Thanks,

Michael

Public