“Invalid reporting query: UNSUPPORTED_VERSION” – Here’s your fix

“Invalid reporting query: UNSUPPORTED_VERSION: RequestError.UNSUPPORTED_VERSION.” 

Here’s a common situation:
You’ve been running a GAds Script for months with zero issues, and then suddenly it decided to just stop working.

The error log shows a message like
“Invalid reporting query: UNSUPPORTED_VERSION: RequestError.UNSUPPORTED_VERSION. (file script.gs, line 123) ”

Usually, this problem is caused by one of these issues:

1) The script is using an outdated version of the API

Most probably the script is using an old version of the Google Ads API that is no longer supported.
This particularly happens when you copy code from the web and the code already is a few years old.

How to fix?

The solution is very easy. You only need to change the API version for the request to the report API.

Find the line in the code that contains the report request and specifies the API version for the report query.

Usually, the statement in that line _starts_ with either ‘AdWordsApp.report’ or ‘AdsApp.report’.
The second argument in the request contains the API version.

Here’s an example:

var report = AdsApp.report(
  'SELECT AdGroupId, Id, Criteria, Impressions, Clicks ' +
  'FROM KEYWORDS_PERFORMANCE_REPORT ' +
  'DURING 20210101,20210301', {
    includeZeroImpressions: false,
    returnMoneyInMicros: true,
    apiVersion: 'v201605'
  });

Simply change the apiVersion to ‘v201809’ (the latest version), and you are good to go.

var report = AdsApp.report(
  'SELECT AdGroupId, Id, Criteria, Impressions, Clicks ' +
  'FROM KEYWORDS_PERFORMANCE_REPORT ' +
  'DURING 20210101,20210301', {
    includeZeroImpressions: false,
    returnMoneyInMicros: true,
    apiVersion: 'v201809'
  });

Or, just leave the version unspecified and you automatically get the latest (working) version by default.
(be sure to remove the comma at the end of the line prior to the apiVersion as well)

var report = AdsApp.report(
  'SELECT AdGroupId, Id, Criteria, Impressions, Clicks ' +
  'FROM KEYWORDS_PERFORMANCE_REPORT ' +
  'DURING 20210101,20210301', {
    includeZeroImpressions: false,
    returnMoneyInMicros: true
  });

Sometimes the API version is specified in a variable somewhere else in the code.

Look for something like the line below, and simply change the value of the variable.
var apiVersion = ‘v201605’;

2) You are running a single account level script from within a manager (MCC) account.

How to fix?

Easy, just run the script in the client account you want to be processed.

Don’t know about the difference between single account level scripts and MCC scripts that run at the manager account level? Read about it here.

 

Interested in running more scripts?
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.