{% set_client %}

Saves custom properties on the client that will survive across multiple sessions until they are changed, unset, or the "session" permission expires. Note that this doesn't mean anything unless the user (or the developer) has granted permission for sessions.

Syntax

{% set_client property1:value1 [property2:"value 2"] ... %}

You may also include reference variables as properties, which will be dereferenced to their property names before setting the client properties.

Examples

Set_client

Copy
{% if request.query_params.hide_popup_for_all_time %} {% set_client show_popup:"false" %} {% endif %}

Set_client multiple dynamic values

Copy
{% if submission.is_valid %} {% var forms_submitted = client.submittedForms | to_int | plus: 1 %} {% var client_formname = form.name.value | prepend: 'submitted' %} {% set_client submittedForms:forms_submitted lastKnownEmail:submission.email &client_formname:'true' %} {% endif %}