I have a graph API call:
https://graph.facebook.com/v8.0/atc_48485453349353/insights/?date_preset=last_14d&fields=account_name,campaign_name,adset_name&level=ad&breakdowns=age,gender&limit=99999999&access_token=ACCESS_TOKEN
I get some data on an ad level. So this will return the maximum number of rows. However, since I'm operating at an ad level with level=ad. There are certain fields that I don't have access to. For example the date_start and date_stop of the campaign and adset level. At the ad level, I can't access the adset budget either.
I don't want to have to make 3 API calls. For all levels. level=campaign, then level=adset, then level=ad
Is there a way to form the request so I can do it all in one API call? (Including a way to get the adset budget in this request)
Related
I wanted to fetch the daily ad spends in Facebook based on campaigns separately, ie, for each campaign with its spend.
I have tried with API call, but that gives state wise classification. How do I group based on campaign names?
"https://graph.facebook.com/v14.0/act_xxxxxx/insights?" + encodeURI("level=ad&fields=spend&access_token=FB_ACCESS_TOKEN&breakdowns=region,country&time_range={'since':'2022-08-09','until':'2022-08-09'}&filtering=[{\"field\":\"country\",\"operator\":\"CONTAIN\",\"value\":\"US\"}]&limit=100")
Campaigns and adsets has an insights field where you can read performance and spending metrics.
Get insights from campaigns endpoint
https://graph.facebook.com/v14.0/act_xxx/campaigns?fields=name,insights{spend}
you can use date filters with you calls to get lifetime spending.
you can also get spending from campaign adset insights field.
Check the official documentation
https://developers.facebook.com/docs/marketing-api/reference/ad-campaign/insights
I'm working on an Ad-tech system which serves millions of users.
Basically users (non anonymous users) can see different Ads that are being created by the marketing team.
Our marketing team want to be able to set some Frequency caps on those Ads (among other targeting rules they already have)
For example:
"We should not show this ad for a user if he already seen/click this ad more than X times in the last Y days"
Also ads can be grouped to campaigns, so rules like that are also possibile:
"We should not show this for a user if he viewed more than X times ads in this campaign in the last Y days".
Also our marketing might wanna know how many people viewed/click a specific add in the last Y days.
We have roughly 200K RPM and our responses should be very fast.
The smallest unit of time for our queries is one day and it will not change.
Few questions and thoughts:
Is DynamoDB a good fit?
I thought about creating a table for each event type (Click/View/Close..)
What is the best way to configure the primary key?
I thought about settings the primary key as the user id and the sort key as a combination of the ad id and the current day {dd/mm/yyyy}
I thought about use "ADD" operation to increase the counter when a user click/view/.. an Ad in a specific date. are they expensive operations? do I have an alternative?
What is the best way I can use to also be able to query per ad and campaigns as well (for example: "all users views for all ads in campaign" or "get all ad views in the last 40 days) ) ?
What other considerations should I take in mind?
Thanks a lot
In Instagram, the reach metric is a de-duplicated data source. In other words, the sum of 7 days worth of data does not necessarily equal the value for that week. This is similar to the Facebook Marketing reach metric.
I'd like to support this scenario: given two dates, give me the reach between those two dates.
In the FB Marketing API this is easily achieved using the since and until parameters to define the date boundaries, and then using a time_increment of all_days to retrieve the reach summed up across all those days.
For example, using the FB Marketing API Docs here is a FB Marketing url that requests a week's worth of data summed up:
{adaccount_id}/insights?metric=reach&since=2018-02-05&until=2018-02-11&time_increment=all_days
In the Instagram Graph API I can define a since and until parameter to define the date boundaries, but there is no parameter like time_increment.
Using the Instagram Graph API Docs, here is a url that requests a week's worth of data split up by day:
{instagram_business_account_id}/insights?metric=reach&period=day&since=1517788800&until=1518307200
Is there any way to change that around to get the summed up reach between two dates? I had hoped for a period option of all_days similar to the FB Marketing API's time_increment parameter but that doesn't exist.
I have integrated the MWS API for my store. The issue is I was not able to get list of all products which I have submitted from feeds and also available products in Amazon store in account.
I have tried all the api of MWS no any api giving all products.
In Listmatchingproducts api it needs query parameter but for product listing there should not be query parameter required.
So for all product listing which api will be used and how?
In order for you to retrieve all of your products without input parameters, you can use the Reports API to request an inventory report or active listings reports or any of the report types here: http://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html#ReportTypeCategories__ListingsReports
You can call the Reports API just like the Products API, but there are extra steps involved. You first request the report using the RequestReport operation, then you'll get back a GeneratedReportId. Take that Id and call the GetReport operation and you'll get back the report once it's available. If you need more than a report, but need to work with the data in some other way, you can just write a routine in whatever language you're using to parse out the data in memory.
Have you seen the client libraries? They do most of the work already, just plug in your keys. https://developer.amazonservices.com/gp/mws/api.html/188-4747010-1589520?ie=UTF8&group=bde§ion=reports&version=latest
Basically there is no specific API to call the product list available in your store. But you can get your products using Reports API (ReportType enumeration)
http://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html#ReportTypeCategories__ListingsReports
There is multiple steps involve in order to work with reports.Here is the steps that involve to get the product listing.
1-RequestReport
2-GetReportRequestList (includes the ReportId when done)
3-GetReport
Have you tried Scratchpad. its for UK marketplace.
https://mws.amazonservices.co.uk/scratchpad/index.html
I use marketing fb graph API through my fb app with developer level access. I need to basically get all data (info about campaigns, ad sets, stats, and so on) as often as possible. There are some limits and I'm reaching them pretty quickly calling graph marketing API. After a few hundred calls I'm stuck with err #17 - request limit reached.
My questions are:
is it possible and how to increase the limit
what's the efficient way of getting all data. I'm mostly interested in tracking changes (smth has been added/ updated/ deleted and stats), but first of course I need to gather all my marketing account data somehow.
Requesting each object for it's info / stats is going to hurt after a while. If you need detailed stats about engagement, social reach, impressions and such, you have a couple options:
The /reportstats endpoint is available for most objects and overs aggregation filters, specificity, column selecting and other useful things and can also be called to asynchronously generate a stats report for all of the objects you requests. This can even be done on an account level. You could easily retrieve a low-level aggregation of delivery stats for the entire tree of objects in your account or campaign.
Another more recent development in their API is the Insights endpoint, which is a centralized endpoint for retrieving stats as well and operates more like the rest of the graph API (request field names, filtering, preset, etc).
I recommend reading up on each for retrieving delivery stats for your ads api objects.
Additionally, if you're looking for the objects' attributes themselves, there are a couple options. The most useful one may be that you can request the graph api with no endpoint and a list of object ids in the params. The request would look like this graph.facebook.com/?ids=000000000. Furthermore, you can use facebook's fields query parameter to return attributes about that object. But, wait; there's more. Facebook's graph api offers field expansion for connected objects through this same query parameter. That is to say, you could request all campaigns' attributes, all ad sets' names and all ad sets' ads' names like so:
curl -G \
-d 'ids=00000000,111111111' \ # ids of campaigns
-d 'fields=name,adcampaigns.limit(50).fields(name),adgroups.limit(50).fields(name)' \
-d 'access_token=xxxxxxxxxx' \
https://graph.facebook.com/v2.4