Function-type attributes
A Function
returns a typed value that indicates the <operator>
and <condition>
that you can use.
For segmentation queries, functions are typically used to abstract subqueries on evented data and create multi-value pseudo-attributes as their return type.
An example is products_purchased()
.
Function names accept the same characters as regular filters, using lowercase alphanumerical and underscore (
snake_case()
).Parameters are optional. However, the parentheses of a parameters list is required.
Parameters can either be named or not, but you can't have a mix of named and unnamed parameters.
The segmentation query syntax has limited support for function-type attributes. Currently only products_purchased()
is supported.
products_purchased()
Anchor link to section titled "products_purchased()"Returns a List<ID>
. As a consequence, CONTAINS
is the right <operator>
to use.
All time ranges
Anchor link to section titled "All time ranges"products_purchased() CONTAINS ID
For example,
Specific time ranges
Anchor link to section titled "Specific time ranges"
Where
The following are examples of using specific time ranges: