Advanced Targeting
Advanced Targeting is a feature that needs to be activated and requires additional setup. Please contact Support if you would like to make use of this feature.
Introduction
Advanced targeting allows admins of an Adhese instance to create complex targeting rules and save those with a label. Sales and operations can choose these targets from a list while booking a campaign.
Creating and Editing
To manage advanced targeting in Adhese, click on the Advance targeting link in the administration screen. The following screen becomes visible:
The screen is divided into two parts:
-
add new advanced target
-
advanced target table
Click Add new advanced target if you want to add a new one. To add a new target, fill in a label, give it a value and hit the Add advanced target button. The code has to be unique to be accepted by the application.
The Advanced targets table lists the created advanced targets.
Creating a new Targeting Expression
Targeting expressions contain target identifiers and functions. The identifiers allow you to tell the system which target you want to check, modify, etc… With the functions, you can express what you want to do with the values.
With ‘target values’ we mean the incoming values of an ad request, independent of how they were injected in the request. So this could be a value sent by the browser or app, or a segment picked up by a server-side mapping or a combination of both.
Defining which targets to use
Targets are referred to by their two-letter prefix code: “dt”, “co”, etc... just like in the POST body of an ad request. The exact values available for your Adhese instance should be in the documentation of your account.
The values of each target are always considered multi-valued, their type is List<String>, a list of alphanumerical characters.
If you know a target is single-valued (as can be set in the ‘definitions’ of your instance), you can use last() to turn the type into String (or Void if an empty list)
Functions to express what to do with a target value
Each function acts on the values sent in by the request and identified by the given target 2-char code. For example, given a request like the one below and using the target code ‘sg’, which is often used for ‘segments’:
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgfamily;sports/ag45/dtdesktop/II456d676e8d6878s687/
We can identify the target by its 2-letter code ‘sg’ and see two values: ‘family’ and 'sports'.
List of all functions
1. Check presence of target
defined(target_code)
Checks if a target is present, even if it has an empty string value.
Example
defined(sg)
will match the following requests
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgfamily;sports/ag45/dtdesktop/II456d676e8d6878s687/
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sg/ag45/dtdesktop/II456d676e8d6878s687/
but not match this one
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/ag45/dtdesktop/II456d676e8d6878s687/
2. Count number of target values
size(target_code)
Counts the number of values for a given target code.
Example
size(sg) > 1
will match
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgfamily;sports/ag45/dtdesktop/II456d676e8d6878s687/
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgfamily/ag45/sggourmet/dtdesktop/II456d676e8d6878s687/
but will not match this one
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgfamily/ag45/dtdesktop/II456d676e8d6878s687/
3. Check presence of value
target_code intersects {'value'}
Returns true if ‘value’ is part of the values for the given target_code
Example
sg intersects {'sports'}
will match
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgfamily;sports/ag45/dtdesktop/II456d676e8d6878s687/
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgsports/ag45/sggourmet/dtdesktop/II456d676e8d6878s687/
but will not match
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgfamily/ag45/dtdesktop/II456d676e8d6878s687/
4. Logical operators
(condition1 && condition2) || (condition3 && condition4)
&& expresses ‘and’, || expresses ‘or’, round brackets can be used for grouping expressions
Example
sg intersects {'family'} || (sg intersects {'sports'} && dt intersects {'desktop'})
will match
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgfamily;sports/ag45/dtdesktop/II456d676e8d6878s687/
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgsports/ag45/sggourmet/dtdesktop/II456d676e8d6878s687/
but will not match
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgsports/ag45/dtmobile/II456d676e8d6878s687/
5. Numerical comparison operators
atoi(last(target_code)) operator integer
Compares the value of a target_code (converted from a string to an integer) with a fixed integer.
Available operators
-
< : less then
-
<= : less then or equal
-
> : greater then
-
>= : greater then or equal
-
<> : not equal
-
= : equal
Example
atoi(last(ag)) > 35 && atoi(last(ag)) <= 65
will match
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgfamily;sports/ag45/dtdesktop/II456d676e8d6878s687/
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgsports/ag65/sggourmet/dtdesktop/II456d676e8d6878s687/
but will not match
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgsports/ag25/dtmobile/II456d676e8d6878s687/
6. Decode urls and split
last(split(decode64(last(target_code))),'/') = string
Converts the last value of the given target_code from base64 encoded to a string, splits it by slash and compares the last item with a string
Example
last(split(decode64(last(br)),'/')) = 'index.html'
will match
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgsports/ag25/dtmobile/II456d676e8d6878s687/rfL2Zvby9iYXIvaW5kZXguaHRtbA==/
but will not match
https://ads-myadheseinstance.adhese.com/json/sl123/tlall/sgsports/ag25/dtmobile/II456d676e8d6878s687/rfL2Zvby9iYXIvb3ZlcnZpZXc=/