Google Ads Script Review – Set URL Tracking Parameters

Today, I had to fix some URL tracking parameters for one of my clients.

Manually fixing UTM parameters to contain the campaign name is Groundhog Day of drudgery. Copy-pasting campaign names in the tracking template or URL suffix is extremely time-consuming and a guaranteed recipe for disaster when you forget to add them to newly created campaigns.

So, why not… Just Script It?

Here’s the script I used to solve my miseries…

What it does:

This Google Ads script provides methods to automate the inclusion of UTM parameters like source, medium, and your campaign name in the Final URL Suffix and ValueTrack parameters. 

Why you’d care:

GA4 can report clicks from Google Ads, and attribute them to the right campaigns IF you have linked GA4 to Google Ads and auto-tagging enabled, AND the user has given consent to do so.

Auto-tagging and GA4 rely on the gclid identifier for tracking, but privacy restrictions and user consent requirements may prevent its processing. When this happens, the campaign attributed to such a session may be labeled as (not set) or occasionally as (organic). Some browsers may remove the gclid parameter in enhanced privacy modes. This can disrupt data collection, leaving gaps in your campaign performance insights.

Adding the right UTM parameters to clicks from your Google Ads account prevents this from happening, and (partly) recovers lost data.

Why I like it:

The script automates the repetitive task of adding UTM parameters to all campaigns, saving you time and effort. It applies a consistent structure across campaigns, eliminating the risk of human error in manual tagging.

The script works across multiple campaign types, including standard Search, Display, Shopping, Performance Max, and (potentially in the future) Demand Gen.

It is straightforward to implement in your Google Ads account, requiring minimal setup. Once configured, it runs without needing ongoing manual intervention.

URL: https://adequate.digital/en/utms-for-google-ads-campaigns/

PRO TIP: Run the script daily to ensure that any newly created campaigns or changes to existing ones are consistently processed.

Happy scripting!

 

Join thousands of PPC geeks who already have access:

If the button above isn’t working for you, you can sign up here to get access.