Community Discussion
Top Campaign Content Report with multi_conversions
Hi All,
I'm currently working on the "Top Campaign Content Report," attempting to retrieve the item report using my own custom conversion. I successfully obtained the report last week using the endpoint provided below:
" <https://backstage.taboola.com/backstage/api/1.0/account_id/reports/top-campaign-content/dimensions/item_breakdown?start_date=2023-12-01&end_date=2023-12-31&include_multi_conversions=true> "
However, when I tried the same endpoint, I only received basic data and static fields without dynamic fields. I have tried this with two different accounts that have custom conversions, but both of these accounts produced the same output. Any ideas on how to fix this issue?
P.s. I'm following the step on this site: <https://developers.taboola.com/backstage-api/reference/top-campaign-content-report>
Posted by Ray Yang 3 months ago
Get images endpoint options
Hello,
Using the example data, calling the <https://backstage.taboola.com/backstage/api/1.0/operations/thirdparty/image> produces 10 images.
I saw no options to specify restrictions or anything else for that image endpoint, and to get more or less than 10 pictures. Is the endpoint limited to exactly 10 photos by search term each time?
Thanks
Posted by Guy Navon 3 months ago
Authorization Code Flow: Taboola Service Unavailable
Hello,
I'm getting the following error when trying to authorize: Taboola Service Unavailable.
From what I researched in the community, this error is related to the redirect_uri that was not added to your white list.
I'm using this API reference: <https://developers.taboola.com/backstage-api/reference/authorization-code-flow>
I sent the redirect URL that I need in the following case via email: 00674968 and 00679177.
Posted by Jhonatan Henrique 3 months ago
targetting specific websites
We are trying to target just a few specific websites (yahoo finance, etc) but when we go
Edit Campaign // Advanced Options // Blocked sites
and try to switch it to include it's greyed out and only says Exclude.
How do we target specific websites?
Posted by cb 4 months ago
Query each site spent in the last seven days against campaign_id and site
i always get 400.
Here's my code. Please help me improve it. Please
```Text python
import requests
from datetime import datetime, timedelta
# ć
šć±ćé
client_id = 'xxx'
client_secret = 'xxx'
access_token = "xxx"
account_id = "xxx-sc"
campaign_id = "xxx"
base_url = "https://backstage.taboola.com/backstage/api/1.0/"
headers = {
"Authorization": f"Bearer {access_token}"
}
def get_access_token(client_id, client_secret):
url = 'https://backstage.taboola.com/backstage/oauth/token'
payload = {
'client_id': client_id,
'client_secret': client_secret,
'grant_type': 'client_credentials'
}
headers = {"content-type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
return response.json()['access_token']
def get_campaign_details(account_id, campaign_id):
url = f"{base_url}{account_id}/campaigns/{campaign_id}/"
response = requests.get(url, headers=headers)
if response.status_code == 200:
return response.json()
else:
print("Error fetching campaign details:", response.status_code)
return None
def get_campaign_summary(account_id, campaign_id, start_date, end_date, site):
url = f"{base_url}{account_id}/reports/campaign-summary/dimensions/day"
params = {
"start_date": start_date,
"end_date": end_date,
"campaign": campaign_id,
"site": site
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
return response.json()
else:
print("Error fetching campaign summary:", response.status_code)
return None
def main():
# access_token = get_access_token(client_id, client_secret)
# print(access_token)
campaign_details = get_campaign_details(account_id, campaign_id)
if campaign_details and 'publisher_targeting' in campaign_details:
sites = campaign_details['publisher_targeting']
if sites:
end_date = datetime.now().date()
start_date = end_date - timedelta(days=7)
site_spent = []
for site in sites:
summary = get_campaign_summary(account_id, campaign_id, start_date, end_date, site)
if summary:
total_spent = sum(item['spent'] for item in summary['results'])
site_spent.append((site, total_spent))
site_spent.sort(key=lambda x: x[1], reverse=True)
print("Top 10 sites by spent:")
for site, spent in site_spent[:10]:
print(f"Site: {site}, Spent: {spent}")
if __name__ == "__main__":
main()
```
Posted by WP Zhao 4 months ago
Not able to aceess placement data.
I am getting below error when i try to get the placement data. Please check once and help me.
ERROR: Invalid response. Array ( [url] => <https://backstage.taboola.com/backstage/api/1.0/inmobi-searcharb-ccsalesnew-sc/reports/campaign-summary/dimensions/campaign_site_day_breakdown?start_date=2023-12-05&end_date=2023-12-05> [code] => 403 [response] => {"http_status":403,"message":"Requested action is forbidden","message_code":"api.action.forbidden"} )
Thanks
Posted by sreenu 4 months ago
Campaign budget type missing in API response
Hello,
is there any way to get the budget type along with the budget value from the API?
At the moment all we can see is that the budget value is being reported under the "daily_cap", but there is no flag that indicates if this budget is "Daily", "Monthly" or "Entire Campaign".
Is this information available?
Thank you for your help.
Posted by Ervin Hoxha 4 months ago
Client ID & Client Secret
Hallo,
I would like to get Client IT und Client Secret for our account 1398182 LK Regionmarketing Carinthia.
How can i do this?
Thanks, Yana
Posted by Yana Holzkecht 4 months ago
403 error when creating campaign
Good Morning
I am trying to create a campaign with a POST call with the following url:
<https://backstage.taboola.com/backstage/api/1.0/prisma-voici-sc/campaigns/>
with the following parameters:
**{
"name": "PMO_voi_article_mobile_android_flux_tag_famille_test_dupli_auto",
"branding_text": "Voici",
"tracking_code": "utm_source=taboola&utm_medium=cpc&utm_campaign=PMO_voi_article_mobile_android_flux_tag_famille_test_dupli_auto_1&utm_term={campaign_id}|{site}|{campaign_item_id}",
"cpc": 0.01,
"daily_cap": 20,
"daily_ad_delivery_model": "STRICT",
"spending_limit": null,
"spending_limit_model": "NONE",
"cpa_goal": 0,
"min_expected_conversions_for_cpa_goal": null,
"country_targeting": {
"type": "INCLUDE",
"value": [
"BE",
"FR",
"CH",
"CA"
],
"href": null
},
"sub_country_targeting": {
"type": "ALL",
"value": \[],
"href": null
},
"dma_country_targeting": {
"type": "ALL",
"value": \[],
"href": null
},
"region_country_targeting": {
"type": "ALL",
"value": \[],
"href": null
},
"city_targeting": {
"type": "ALL",
"value": \[],
"href": null
},
"contextual_targeting": {
"type": "ALL",
"value": \[],
"href": null
},
"platform_targeting": {
"type": "INCLUDE",
"value": [
"PHON",
"TBLT"
],
"href": null
},
"publisher_targeting": {
"type": "EXCLUDE",
"value": [
"ladpche-web",
"midi-libre-web"
],
"href": null
},
"auto_publisher_targeting": {
"type": "ALL",
"value": \[],
"href": null
},
"os_targeting": {
"type": "INCLUDE",
"value": \[
{
"os_family": "Android",
"sub_categories": \[]
}
],
"href": null
},
"connection_type_targeting": {
"type": "ALL",
"value": \[],
"href": null
},
"campaign_profile": null,
"comments": "",
"bid_type": "FIXED",
"bid_strategy": "FIXED",
"traffic_allocation_mode": "OPTIMIZED",
"external_brand_safety": {
"type": "NONE",
"values": \[]
},
"campaign_groups": null,
"target_cpa": null,
"conversion_rules": {
"rules": \[]
},
"funnel_template": null,
"traffic_allocation_ab_test_end_date": null,
"approval_state": "APPROVED",
"is_active": true,
"contextual_segments_targeting": {
"state": "ALL",
"value": null,
"href": "https\:\\\/\\\/backstage.taboola.com\\\/backstage\\\/api\\\/1.0\\\/prisma-voici-sc\\\/campaigns\\\/30742854\\\/targeting\\\/contextual_segments"
},
"custom_contextual_targeting": {
"state": "ALL",
"value": null,
"href": "https\:\\\/\\\/backstage.taboola.com\\\/backstage\\\/api\\\/1.0\\\/prisma-voici-sc\\\/campaigns\\\/30742854\\\/targeting\\\/custom_contextual_segments"
},
"custom_audience_targeting": {
"state": "ALL",
"value": null,
"href": "https\:\\\/\\\/backstage.taboola.com\\\/backstage\\\/api\\\/1.0\\\/prisma-voici-sc\\\/campaigns\\\/30742854\\\/targeting\\\/custom_audience"
},
"segments_targeting": {
"AGE": {
"type": "ALL",
"value": \[],
"href": "https\:\\\/\\\/backstage.taboola.com\\\/backstage\\\/api\\\/1.0\\\/prisma-voici-sc\\\/campaigns\\\/30742854\\\/targeting\\\/age_segments"
},
"GENDER": {
"type": "ALL",
"value": \[],
"href": "https\:\\\/\\\/backstage.taboola.com\\\/backstage\\\/api\\\/1.0\\\/prisma-voici-sc\\\/campaigns\\\/30742854\\\/targeting\\\/gender_segments"
}
},
"segments_multi_targeting": null,
"marketing_objective": "DRIVE_WEBSITE_TRAFFIC",
"verification_pixel": null,
"viewability_tag": null,
"activity_schedule": {
"mode": "ALWAYS",
"rules": \[],
"time_zone": "Europe\\\/Paris"
},
"browser_targeting": {
"type": "ALL",
"value": \[],
"href": null
},
"type": "PAID",
"is_spend_guard_active": "ACTIVE"
}**
and i am always having this error:
**Erreur : {"http_status":403,"message":"Requested action is forbidden","message_code":"api.action.forbidden"}**
i am using a user id provider for my account and our liaison in Taboola confirs that the user have the editing campaign rights
Thank you
**Bouraoui Mejri Prima Media IT development department**
Posted by Bouraoui Mejri 4 months ago
Cannot use campaign filter in campaign_site_day_breakdown
Hi! Trying to filter by campaign in campaign_site_day_breakdown report, but getting "Filter 'campaign' has invalid value"
My query: <https://backstage.taboola.com/backstage/api/1.0/campaign-name/reports/campaign-summary/dimensions/campaign_site_day_breakdown?start_date=2023-11-28&end_date=2023-11-29&campaign=12345678>
(changed real IDs with similar)
Posted by Oleksandr 4 months ago