SmartAPI: Let's say we already configured SmartAPI for fetching data from any weather API. Now we've two configurations:
Config 1:
Now we uploaded the feed inside smartTag and Add Filters:
- AND Logic, selectors_data[city] contains 'Rome'
- AND Logic, selectors_data[city] contains 'Singapore'
That means only 'Rome' and 'Singapore' city weather will be fetch from the API.
Config 2:
We created the AdUnit, we'll now add Add AD generation Rules :
- AND Logic, selectors_data[weather] contains 'rain, rainy'
- AND Logic, selectors_data[weather] contains 'cloud, cloudy'
- AND Logic, selectors_data[weather] contains 'sunny, clear'
If we do above config, that means when we're creating variants - we need to create 6 varaints.
- city = 'Rome' AND weather ~= 'rain, rainy'
- city = 'Rome' AND weather ~= 'cloud, cloudy'
- city = 'Rome' AND weather ~= 'sunny, clear'
- city = 'Singapore' AND weather ~= 'rain, rainy'
- city = 'Singapore' AND weather ~= 'cloud, cloudy'
- city = 'Singapore' AND weather ~= 'sunny, clear'
Example 1: Weather
- Variant 1: City [Singapore]
- title
- description
- custom_text_1 (e.g. from API: temperature)
- custom_text_2 (e.g. from API: weatherType)
- custom_text_3 (e.g. from API: city)
- custom_image_1
- custom_image_2
Macros
- weatherType: 'sunny, clear' [Condition: contains]
- city: singapore [Condition: equal]
- Variant 2: City [Singapore]
- title
- description
- custom_text_1 (e.g. from API: temperature)
- custom_text_2 (e.g. from API: weatherType)
- custom_text_3 (e.g. from API: city)
- custom_image_1
- custom_image_2
Macros
- weatherType: 'cloud, cloudy' [Condition: contains]
- city: singapore [Condition: equal]
- Variant 3: City [Minsk]
- title
- description
- custom_text_1 (e.g. from API: temperature)
- custom_text_2 (e.g. from API: weatherType)
- custom_text_3 (e.g. from API: city)
- custom_image_1
- custom_image_2
Macros
- weatherType: 'rain, rainy' [Condition: contains]
- city: minsk [Condition: equal]
Ad Serving Logic
- We need to add connecting macro in SmartTag. In this case, it's city.
Option 1: Geo Targeting
- If enabled, it'll ask browser permission to share location.
- if shared, we'll get lat/long of user and from lat/long find the
city
from our IP database - if not shared, we'll get the IP address and get city from our IP database
- if shared, we'll get lat/long of user and from lat/long find the
Option 2: Smart Macro %g
- if selected from "SMART MACRO" in AdUnit level, we'd expect city, country, zip from DV360 ad server. Based on the city code we'll find the city name do the match.
Option 3: Nothing selected
- we'll take user's IP address and get the city name from our IP database.
let's say option 1 is enabled for now. So, from browser location sharing we got "singapore" as the city. So, we'll find the necessary data from SmartTag API pages.
Let's assume, the data from API is showing singapore is having temparature 30 degree with weather type as "cloudy". So, we'll show the Variant 2
in this case..
Example 2: Stock API
- Variant 1: Category: 'Food'
- title
- description
- custom_text_1 (e.g. from API: category)
- custom_text_2 (e.g. from API: price)
- custom_text_3 (e.g. from API: stockName)
- custom_image_1
- custom_image_2
Macros
- LINE_ITEM: 111 [Condition: Equal] (default)
- category: 'food' [Condition: Equal]
- Variant 1: Category: 'Entertainment'
- title
- description
- custom_text_1 (e.g. from API: category)
- custom_text_2 (e.g. from API: price)
- custom_text_3 (e.g. from API: stockName)
- custom_image_1
- custom_image_2
Macros
- LINE_ITEM: 222 [Condition: Equal] (default)
- category: 'entertainement' [Condition: Equal]
Ad Serving Logic
- Here, the SmartTag connecting macro is "LINE_ITEM" and value is "category".
- For this example, from CampaignManager we'll receive
line=<?>
- based on the
line
value (e.g. 222) we know, server is asking for which (e.g. 222 = "entertainment") category. - Then, we'll get a variant of "entertainment" category and show in the template
Example 3: Football (LFC vs MANU)
- Variant 1: LFC Wins
- title
- description
- custom_text_1 (e.g. from API: score)
- custom_text_2 (e.g. from API: StadiumName)
- custom_text_3 (e.g. from API: result)
- custom_image_1
- custom_image_2
Macros
- result: 'H' [Condition: Equal] (default)
- Variant 2: MANU Wins
- title
- description
- custom_text_1 (e.g. from API: score)
- custom_text_2 (e.g. from API: StadiumName)
- custom_text_3 (e.g. from API: result)
- custom_image_1
- custom_image_2
Macros
- result: 'A' [Condition: Equal] (default)
- Variant 3: Match Draw
- title
- description
- custom_text_1 (e.g. from API: score)
- custom_text_2 (e.g. from API: StadiumName)
- custom_text_3 (e.g. from API: result)
- custom_image_1
- custom_image_2
Macros
- result: 'D' [Condition: Equal] (default)
Ad Serving Logic
- while setting the SmartTag, we'll add connecting macros. It'l' show as "MACROS" in smartTag edit page.
- for this API, we'll select
result
as connecting macro. - Our system will find the API page where
result = 'H'
. Then, based on that will matchVariant 1
to show.
Problems:
- Need to find an API where they return which team won the match or the result of the match. not just the score.
Let's say, some football API returns this data:
So, in our SmartTag - we'll create 2 pages as there are 2 matches between 4 different teams. In each page, there will be
team1, team2, result
.Now, in our Ad Level, we need to create variants. We can create variants like:
So, when our Ad is going to serve - we need a
connection
parameter that will connect both the variants and the pages. That's why I proposedline
as a connection parameter. Consider the following case:If we always want to show the win variants - then which team win will show? Here, both Manchester United FC, Aston Villa FC wins. If we pick random, then no need for a
connection
parameter.Same goes for COVID or Weather API.
As you can see, different API examples (COVID, Weather, Stock, Football, Cricket etc.) or scenarios have different use cases. We have to come to a generalise solution that will work for all cases - that's why I'm trying to discuss. Otherwise, we need to customize for every API scenarios.