Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission Error with creative_sourcing_spec #678

Open
Douglas42digital opened this issue Jul 26, 2024 · 0 comments
Open

Permission Error with creative_sourcing_spec #678

Douglas42digital opened this issue Jul 26, 2024 · 0 comments

Comments

@Douglas42digital
Copy link

Douglas42digital commented Jul 26, 2024

`sitelinks = [
{
'site_link_title': 'Link 1 Title',
'site_link_url': 'https://example.com/link1'
},
{
'site_link_title': 'Link 2 Title',
'site_link_url': 'https://example.com/link2'
},
]

promotion_metadata = [
{
'end_date': 1627776000,
'promotion_source': 'ADVERTISER_INPUT',
'promotion_type': 'PERCENTAGE_OFF',
'promotion_value': 10.0,
'required_code': 'SUMMER10',
'start_date': 1625097600,
}
]
creative_sourcing_spec = {
"site_links_spec": sitelinks,
# "promotion_metadata_spec": promotion_metadata,
"source_url": 'https://www.digital.de/'
}

creative_params = {
'name': 'Your Ad Creative Name',
'object_story_spec': {
'page_id': page_id,
'instagram_actor_id': instagram_page_id,
'link_data': {
'link': 'https://www.digital.de/',
'message': 'Testing Your ad message',
'name': 'Testing Your headline',
'description': 'Testing Your ad description',
}
},
'contextual_multi_ads': {
"enroll_status": "OPT_IN"
},
'degrees_of_freedom_spec': {
'creative_features_spec': {
'standard_enhancements': {
'enroll_status': 'OPT_IN'
}
}
},
'creative_sourcing_spec': creative_sourcing_spec
}

ad_creative = AdAccount(ad_account_id).create_ad_creative(fields=[], params=creative_params)
print(ad_creative)

ad_params = {
'name': 'Testing Site Links and Offers Ad Name',
'adset_id': 209987......,
'creative': {'creative_id': ad_creative['id']},
'status': 'PAUSED',
}

AdAccount(ad_account_id).create_ad(fields=[], params=ad_params)
`

What permissions are required to use creative_sourcing_spec? Is the above implementation correct for using sitelinks and promotion metadata in an ad?

@Douglas42digital Douglas42digital changed the title Application does not have permission for this action Permission Error with creative_sourcing_spec Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant