Proactive Conversion Tracking: The Script Every Google Ads Account Needs

One of the biggest nightmares for a digital marketer is realizing your conversion tracking has broken—especially if it’s been down for days without you noticing. It’s something that a PPC pro shouldn’t have to check every day, but unfortunately, this scenario is more common than you might think. At Granular, we wanted to ensure our team never falls victim to broken tracking, so we developed a conversion decrease script for our Google Ads accounts. Let me show you how to use this script to safeguard your conversion tracking.

This script isn’t specifically designed to alert you that conversion tracking has stopped working. That takes more involved website tagging and code that often falls outside of the average PPC professional skillset. Instead, our Google Ads script notifies you if your total conversions for a selected date range drop by more than 95% compared to the previous period. And most PPCers can find their way around the Google Ads script library just fine.

Note that the script only runs if your campaigns are enabled. A significant decrease in conversions could indicate poor performance or a potential tracking issue. Both are worth investigating immediately. 

I initially found a script written by an Italian digital marketing team and rewrote it to suit our needs. The script lets you compare conversions for a single day, three days, or seven days. While shorter time periods mean you can catch anomalies faster, it also may trigger more false alerts – so adjust it to your specific account needs. 

Snippet of Google Ads script code displaying the 'CONVERSION_DECREASE_THRESHOLD' set at 95% and a list of email recipients for alert notifications

Key Customizations in the Script

When you open the script in your editor (notepad or simple code editor of choice), the first two line items are crucial:

  1. CONVERSION_DECREASE_THRESHOLD: This is the percentage decrease that triggers an alert. For us, it’s set at 95%. If you want the threshold to be 80%, enter 0.80 instead. This will depend on how sensitive your alerts should be, usually based on your account conversion volume and typical performance. 
  2. EMAIL_RECIPIENTS: Add your email address and any additional recipients, such as a support team member.
Section of the Google Ads script defining date ranges for comparing conversion data. It includes parameters to fetch conversion data for the last day, last seven days, and previous two weeks.

If you’d like the script to run for 14 days instead of 1, 3, or 7, modify the start and end dates:

  • Set startDateRecent to 14.
  • Set endDatePrevious to 15.
  • Set startDatePrevious to 28.

Make these changes carefully and test for accuracy.

Implementing the Script

After customizing the script to fit your needs, including setting the email address and threshold, follow these steps:

  1. Copy and paste the script into your Google Ads script editor. Access this by navigating to Tools > Bulk Actions > Scripts in Google Ads.
  2. Click Add New Script and paste your code into the editor. Save it or preview it first. Previewing helps you understand how the script operates.
  3. During the preview, check the “log” to see the script’s output:
    • If conversions for the selected period meet or exceed the threshold, no alert will be sent.
    • If conversions drop below the threshold, the script will notify you via email.
  4. Once you’re confident in the script’s functionality, save it and schedule it to run daily. We recommend running it early in the workday, around 8-9 AM.

How the Script Helps

When previewing, review the log to confirm whether conversions increased or decreased by no more than 95% compared to the previous period. If the script detects a drop below the threshold, it will send an email alert.

Log output from the Google Ads script showing the script running successfully. The log confirms that conversions are above the alert threshold, so no email notification was sent.

The email keeps you informed about the performance of your conversion tracking, allowing you to proactively address potential issues.

Screenshot of an automated email alert titled 'Account Conversions Report,' indicating a significant drop in conversions from December 29, 2024, to December 31, 2024, potentially due to broken conversion tracking.

If you’d like to customize the email content, you can do so by editing lines 48-63 in the script’s HTML.

We’d love to hear how this script works for you and your team. If you need help with conversion tracking or digital strategy, feel free to reach out to us.

Additional Resources

Below, you will find the written scripts for your use:


Questions?

If you have any questions or are interested in having Granular help grow your business, please use the button below to get in touch!

Related Articles