Hi support team,
I'm trying to activate/pause an ad group with the code listed below, but I'm getting the following errors:
====================ERRORS====================
SystemError: Could not read from Google Ads
(Internal details: Error in mutate response: [
{
"errorCode": {
"authorizationError": "ACTION_NOT_PERMITTED"
},
"message": "The user does not have permission to perform this action on the resource or call a method."
},
{
"errorCode": {
"authorizationError": "ACTION_NOT_PERMITTED"
},
"message": "The user does not have permission to perform this action on the resource or call a method.",
"location": {
"fieldPathElements": [
{
"fieldName": "mutate_operations",
"index": 0
},
{
"fieldName": "ad_group_operation"
}
]
}
}
])
at g (adsapp_compiled:273:50)
at Qc (adsapp_compiled:828:15)
at Rc (adsapp_compiled:831:3)
at wH.mutate (adsapp_compiled:18544:16)
at eH (adsapp_compiled:18077:17)
at fH.flush (adsapp_compiled:18159:71)
at gH.flush (adsapp_compiled:18227:13)
at gH.search (adsapp_compiled:18206:10)
at nH.search (adsapp_compiled:18299:19)
at kd (adsapp_compiled:1055:32)
====================CODE====================
function switchAdGroupStatus(adGroupName, activate) {
var selectors = [
AdsApp.adGroups(),
AdsApp.videoAdGroups(),
AdsApp.shoppingAdGroups()
];
for(var i = 0; i < selectors.length; i++) {
var adGroupIter = selectors[i]
.withCondition('Name = "' + adGroupName + '"')
.get();
if (adGroupIter.hasNext()) {
var currentAdGroup = adGroupIter.next();
if (activate) {
currentAdGroup.enable();
} else {
currentAdGroup.pause();
}
}
}
}