/
SDK Ad Ops Tasks Examples
SDK Ad Ops Tasks Examples
On this page, you will find examples of common ad ops tasks that can be made easier by using SDK. Please keep in mind that these examples might include details that should be altered depending on your use case.
Change Supply Tag Optimization Metric to Revenue per Second
import springserve
tag_ids = [1,2,3]
for i in tag_ids:
st = springserve.supply_tags.get(i)
st.optimization = {'active': True,
'version': '',
'learn_pct': '1.0',
'mode': 'black_box',
'settings': {'metric': 'revenue_per_second', 'lookback_minutes': '60'}}
resp = st.save()
if resp.ok == True:
print(st.id, resp.ok)
else:
print(st.id, resp.error)
Add Reporting Keys on Multiple Supply Tags
import springserve
tag_ids = [1,2]
for i in tag_ids:
st = springserve.supply_tags.get(i)
if st.key_ids == []:
st.key_ids = [300, 400]
resp = st.save()
print(st.id, resp.ok)
else:
st.key_ids.extend([300, 400])
resp = st.save()
print(st.id, resp.ok)
Add Impression Frequency Caps on Multiple Demand Tags
import springserve
tag_ids = [1,2,3]
for i in tag_ids:
dt = springserve.demand_tags.get(i)
dt.frequency_caps.append({
'frequency_cap_period': 'minute',
'frequency_cap_period_amount': 3,
'frequency_cap_metric': 'impressions',
'frequency_cap_value': 3,
'frequency_cap_type': 'springserve',
'frequency_cap_third_party_id': None})
resp = dt.save()
if resp.ok == True:
print(dt.id, resp.ok)
else:
print(dt.id, resp.error)
Add Budgets on Multiple Demand Tags
import springserve
tag_ids = [1,2,3]
for i in tag_ids:
dt = springserve.demand_tags.get(i)
dt.budgets.append({
'budget_metric': 'impressions',
'budget_period': 'month',
'budget_pacing': 'even',
'budget_value': 111111,
'vast_caching_adjustment': False,
'vast_caching_lookback_seconds': None,
'vast_caching_multiplier': None,
'ignore_supply_allocations': False,
'budget_value_currency': 'USD'})
resp = dt.save()
if resp.ok == True:
print(dt.id, resp.ok)
else:
print(dt.id, resp.error)
, multiple selections available,
Related content
SpringServe API / SDK
SpringServe API / SDK
Read with this
Advertiser Domain Lists API
Advertiser Domain Lists API
Read with this
Macros
More like this
SpringServe in ads.txt
SpringServe in ads.txt
More like this
Segments API
Segments API
Read with this
CL -Demand Tag API
CL -Demand Tag API
More like this