-
Notifications
You must be signed in to change notification settings - Fork 649
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
Where do I get the placement and site_source_name values in the SDK? #671
Comments
Hi @edpruuv 👋 When you run, your example below -> you are requesting the endpoint {ad-account-id}/campaigns https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group/#fields connection = AdAccount(customer_id)
campaigns = connection.get_campaigns(fields=fields, params=params) I think you misunderstood the breakdowns parts witch is related to the insights 🛑 All breakdowns are not always compatible with each others ( combining breakdowns ) # {ad-account-id}/insights
account = AdAccount("act_" + self.account_id)
insights = account.get_insights(
fields= [ "account_id", .... , "clicks", "impressions", "spend" ... ]
params={
"use_unified_attribution_setting": True,
"breakdowns": [
"publisher_platform",
"platform_position",
"impression_device",
],
"level": "ad",
"time_increment": 1,
"time_range": {
"since": XYZ,
"until": XYZ,
},
},
is_async=True,
)
insights.api_get() |
Thanks a ton @Just1B ! I will try this now. Your comment is greatly appreciated! Cheers! |
I got the folowing insight data @Just1B
My next(and main) question is what breakdown parameter should I pass to get the value of these dynamic variables in the url tag:{{placement}}{{site_source_name}}Specifications for URL dynamic parameters link: What am I missing here?P.S. You're response is greatly appreciated |
i think you can get them on the adcreative https://developers.facebook.com/docs/instagram/ads-api/guides/get-ad-insights/ https://developers.facebook.com/docs/marketing-api/reference/ad-creative#fields |
We already have
That's why I need to find where I can get the Please advice. Thank you |
Hey @edpruuv how's it going? Were you able to find any solution to this problem? I'm facing the same issue that you mentioned |
Given this url tag placement={{placement}} site_source_name={{site_source_name}}
Where do I get these values using the SDK?
Which specific field in the following to they belong?
Campaign.Field
AdSet.Field
Ad.Field
I tried the following:
`
CAMPAIGN_FIELDS = [
Campaign.Field.account_id,
Campaign.Field.id,
Campaign.Field.name,
Campaign.Field.budget_remaining,
Campaign.Field.objective,
]
connection = AdAccount(customer_id)
params = {
campaigns = connection.get_campaigns(fields=fields, params=params)
`
But all I get is this output:
{ "account_id": "1**705********1241", "budget_remaining": "0", "id": "120208422448000423", "name": "Creative and Audience Test", "objective": "OUTCOME_LEADS" }
Should I go for the Adset or Ad level?
Please help!
The text was updated successfully, but these errors were encountered: