How to track Google Ads conversions in Drupal (gtag.js) on specific pages

gtag.js Conversion Tracking in Drupal 7

My Drupal pro tip today only concerns Drupal 7 (sadly), because the tracking_code module is not available for Drupal 8 currently.

My little task was to add a Google Ads conversion tracking on a customer page. Google Ads uses gtag.js.

I first tried the Google Tag Manager module. That was not helpful because it required a Google tag manager container my customer didn't need.

A great solution comes with the
Tracking Code
Module. It helps with custom tracking code integration in the <head> area and provides:

If you know a good UI solution for Drupal 8, contact me to add it here. For example you could try 8.x-3.x which has a gtag.js integration.