consent_purpose Function

Generates HTML attributes for an element to document buyer consent scope:

<script type="text/javascript" {{ consent_purpose('statistics') }}>

This function can be used in conjunction with Square Online’s cookie consent functionality to indicate what permissions from a buyer that script and its related cookies need.

Valid consent purposes are:

  • necessary: Cookies that are required for the site to function
  • marketing: Cookies used in marketing functionality
  • statistics: Cookies used to track buyer actions or site events
  • preferences: Cookies used to store and apply the buyer’s preferences