I’ve been creating an AdExchange Line Item and an Ad Exchange creative on Google Ad Manager using the API.
Now I can’t create the line item creative association between the two objects.
Creative is as follows :
Creative = {
'advertiserId': [ADVERTISER_ID],
'id': [CREATIVE_ID],
'name': 'My Ad Exchange creative',
'size': {
'width': 1,
'height': 1,
'isAspectRatio': False
},
'previewUrl': '[PREVIEW_URL]',
'policyLabels': [],
'appliedLabels': [],
'lastModifiedDateTime': {[CREATION_TIME]},
'customFieldValues': [],
'thirdPartyDataDeclaration': None,
'codeSnippet': "[CODE_SNIPPET]",
'isNativeEligible': False,
'isInterstitial': False,
'isAllowsAllRequestedSizes': False
}
And has been created using following instructions :
Creative = {
'advertiserId': [ADVERTISER_ID],
'xsi_type': 'AdExchangeCreative',
'name': 'My Ad Exchange creative',
'size': {
'width': 1,
'height': 1,
'isAspectRatio': False
}
,'codeSnippet': "[CODE_SNIPPET]"
}
service("CreativeService").createCreatives([Creative])
Line item is of course a lot bigger object but let me give some details :
line = {
[...]
'id': [LINE_ID],
'lineItemType': 'AD_EXCHANGE',
'priority': 12,
'creativePlaceholders': [
{
'size': {
'width': 1,
'height': 1,
'isAspectRatio': False
},
'creativeTemplateId': None,
'companions': [],
'appliedLabels': [],
'effectiveAppliedLabels': [],
'expectedCreativeCount': 1,
'creativeSizeType': 'IGNORED',
'targetingName': None,
'isAmpOnly': False
}
],
}
The important thing here is to note that line item is an AdExchange one and has a creative placeholder containing the size of the previously created creative.
I’ve been trying different setups to link the two like eg :
association = {'creativeId': [CREATIVE_ID],'lineItemId': [LINE_ID]}
or :
association = {'creativeId': [CREATIVE_ID],'lineItemId': [LINE_ID], 'sizes':[]}
or :
association = {'creativeId': [CREATIVE_ID],'lineItemId': [LINE_ID],
sizes :[ {'width': 1,'height': 1,'isAspectRatio': False}
}
But whatever the setup among these used into the createLineItemCreativeAssociations function, I always get the same error message :
googleads.errors.GoogleAdsServerFault: [RequiredSizeError.NOT_ALLOWED @ [0].size; trigger:'1x1-null']
Has anyone bumped into that issue before, and maybe figured out a solution ?