Geo Script
Conditionally run internal or external JavaScript code, based on one or more conditions you have defined with the visitor data properties.
Last updated
Was this helpful?
Conditionally run internal or external JavaScript code, based on one or more conditions you have defined with the visitor data properties.
Last updated
Was this helpful?
Geoflow evaluates the conditions defined in the Geo Script data attribute against the visitor data properties. If the conditions match (returns true), the internal or external JavaScript code will run. Otherwise, it will be left as-is and the code won't run.
By default, Geoflow will run the code if any conditions you have defined match (return true). You can override this default behaviour by applying the Geo Match data attribute.
Attribute Name | Attribute Value | Which Page Element? |
---|---|---|
The type attribute is required to prevent the browser from automatically running the JS.
The condition name is case-sensitive and must match the 'Property Variable' for that visitor data property in the Visitor Data Properties table.
The case sensitivity and validity for the condition value depend on the data type. For example, when defining a condition based on a country code, the value must be an ISO Alpha-2 Code.
Any value other than 'all' added for the Geo Match data attribute will have no effect.
*ββββ βAttribute names with a red asterisk are required; all others listed in the table are optional.
type*
text/geoflow
<script>
data-geo-script*
conditionName:conditionValue
<script>
data-geo-match
all
Any element with the Geo Script data attribute.