Script profile attributes are name/value pairs defined in the Adobe Target solution. The value is determined from executing a JavaScript snippet on Target’s server per server call.
Users write small code snippets that execute per mbox call, and before a visitor is evaluated for audience and activity membership.
Script profile attributes are created in the Audiences section of Target. Any attribute name is valid, and the value is the result of a JavaScript function written by the Target user. The attribute name is automatically prefixed by " user. " in Target to distinguish them from in-page profile attributes.
The code snippet is written in the Rhino JS language and can reference tokens and other values.
Requires no page code updates.
Executes before audience and activity membership decisions, so these profile script attributes can affect membership on a single server call.
Can be very robust. As many as 2,000 instructions can be executed per script.
Requires JavaScript knowledge.
The execution order of profile scripts cannot be guaranteed, so they cannot rely on each other.
Can be difficult to debug.
Profile scripts are quite flexible:
user.purchase_recency: var dayInMillis = 3600 * 24 * 1000; if (mbox.name == 'orderThankyouPage') { user.setLocal('lastPurchaseTime', new Date().getTime()); } var lastPurchaseTime = user.getLocal('lastPurchaseTime'); if (lastPurchaseTime) { return ((new Date()).getTime()-lastPurchaseTime)/dayInMillis; }