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.
@imtiaz-emu
Config 1: For smart tag I think it should be
OR Logic, selectors_data[city] contains 'Rome'
OR Logic, selectors_data[city] contains 'Singapore'
Config 2: @travis got your comment.
city
parameter we got from user location (geo) or from IP, right?temperature
value is already present at ourpages
dataLINE_ITEM
- As I understand LINE_ITEM is weather_type or some other targeting coming from display network? Will get it through params.Now about matching.
SmartTagFilter
hasbody
(value) andcondition type
(equal, more them, less then etc).Macro
has onlyvalue
right now without condition. To make it work with temperature (<, >, >=, <= etc) we should think about:filters
table asAD generation Rules
. In this case it will load database each time make more queries to database to fetch not only ads macros, but also ads filters.macro
side. like add new fieldcondition_type
. By default it will beequal
. (to match city, or line item etc). But it can be (<, >, <=, >=) etcAnother option is to have a rule, that if macro value contains condition sign (<, > ...) before the value - it will be parsed and transformed into a logical rule to match.
Anyway lets discuss it today in skype. I think I have to do the same thing about macro rules for Porsche campaign 👍