Conditions


Conditions can be leveraged in order to enable or disable geographic targets in response to external circumstances. Conditions are linked to a line items and locations. Conditions are periodically reevaluated in order to determine geo-target eligibility.

Define

Conditions

A condition is defined by a simple JavaScript snippet that gets re-executed every few hours. If expression returns 'false', linked geo-targets are temporarily disabled. A condition is also linked to a URL that can be used to perform REST request. URL may embed location property variables (e.g. ${lat} and ${lon}) in order to customize request.

Warning: conditions allow for arbitrary, non-sandboxed scripting so be careful not to do something stupid like deleting hard drive. If end-users wish to write their own scripts, their SWMF server must run within their own isolated environment.

Test

Conditions can be tested using the 'Test' dialog. Use 'print' statements to assist with debugging.

Condition Test