“MutateError.UNSPECIFIED: Specified version ‘v[X]’ not supported.” – Here’s your fix

“MutateError.UNSPECIFIED: Specified version ‘v[X]’ not supported.” 

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.

OR

You jus copy-pasted a script from somewhere on the web (ie: the Account Anomaly Detector script from Google), tried to run it, but then this error popped up.

The error log shows a message like
“MutateError.UNSPECIFIED: Specified version ‘v11’ not supported. ”

or for the older versions:

“MutateError.UNSPECIFIED: Specified version ‘v10’ not supported. ”

“MutateError.UNSPECIFIED: Specified version ‘v9’ not supported. ”

 

Cause of the problem:

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 is already 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 GoogleAds Search Service.

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

The statement in that line _starts_ with a call to the  ‘AdsApp.search’ method.
The second argument in the request contains the API version.

Here’s an example:

var query = "SELECT shared_set.id, shared_criterion.keyword.match_type, shared_criterion.keyword.text FROM shared_criterion";

var result = AdsApp.search(query, {apiVersion: 'v9'});

The search method allows for optional arguments that specify the Google Ads API version to query. Sunsetted versions are not allowed.

Simply remove the optional argument, and you are good to go.

var query = "SELECT shared_set.id, shared_criterion.keyword.match_type, shared_criterion.keyword.text FROM shared_criterion";

var result = AdsApp.search(query);

Removing the optional argument that specifies the API version makes the code default to the latest version.

Easy fix, right?

Sometimes the version number is not specified on the same line that states the ‘AdsApp.search’ method.
It might be configured elsewhere in the code using configuration variables, like for instance in Google’a Account Anomaly Detector script. In this particular case,  simply comment out the following line to default to the latest reporting version.

'apiVersion': 'v10'

so simply add two slashes in front (and see the color change to confirm that part of the code now is commented out:

// 'apiVersion': 'v10'

 

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.