googleads-dfa-reporting-samples
googleads-dfa-reporting-samples copied to clipboard
Copy Creative API issue
Hi team, We have a copy creative requirement. We are using Python Client Library for CM360 API We didn't see any API for Copy Creative(In CM360 API explorer), so we are using the below steps to create a copy of Creative
- Search creative in Campaign and get the Creative ID.
- If creative is available in the campaign, we will mark the creative ID.
- If creative is not found in the campaign, we will search in the advertiser if it is found will mark the creative id.
- For copy creative we are using below API calls First, we will call creatives().get() API using creative ID- Fetch the creative information from CM360 creatives().get(profileId=profile_id, id=creative_id) Then using Creative create API creatives().insert() - In DCM create a new copy of the creative with a new name [service.creatives().insert(profileId=profile_id, body=creative_body)] with the following request body. .
For creative_type == 'html', the request body is as follows. new_cr_body = { 'active': 'true', 'advertiserId': advertiser_id, 'creativeAssets': new_cr_assets, 'backupImageClickThroughUrl': {'landingPageId': default_landing_page['id']}, 'backupImageReportingLabel': 'backup_image_exit', 'backupImageTargetWindow': {'targetWindowOption': 'NEW_WINDOW'}, 'name': new_cr_name, 'size': new_cr_size, 'clickTags':new_cr_clicktags, 'type': 'DISPLAY' } For creative_type == 'image', the request body is as follows.
new_cr_body = {
'active': 'true',
'advertiserId': advertiser_id,
'creativeAssets': new_cr_assets,
'name': new_cr_name,
'size': new_cr_size,
'type': 'DISPLAY'
}
we can copy HTML and image creatives using the above request body. These steps are working fine for both HTML and Image.
For Rich Media Display banner creatives we tried the following request body. new_cr_body = { 'active': 'true', 'advertiserId': advertiser_id, 'creativeAssets': new_cr_assets, 'backupImageClickThroughUrl': {'landingPageId': default_landing_page['id']}, 'backupImageReportingLabel': 'backup_image_exit', 'backupImageTargetWindow': {'targetWindowOption': 'NEW_WINDOW'}, 'name': new_cr_name, 'size': new_cr_size, 'exitCustomEvents':new_cr_cust_events, 'type': 'RICH_MEDIA_DISPLAY_BANNER' }
When we use the same for RichMedia, we are getting the below error message( Creative asset file not found error)
{'status': 'failed', 'message': '<HttpError 400 when requesting
https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/
Please Help us resolve this issue if any parameter is missing or pls suggest any alternate way to make a copy of Rich Media Creative,