Get tracking consent

Ecwid.getTrackingConsent(); provides information about customer's consent to be tracked on store pages.

Get status of customer's consent to be tracked:

Ecwid.getTrackingConsent();

// {  userResponse: "ACCEPTED", askConsent: true }

Fields

NameTypeDescription
userResponsestringCustomer's preferred choice for being tracked. Possible values: "ACCEPTED" - user agreed to collect all types of cookies,
"DECLINED" - user declined all additional cookies, and agreed to collect only essential cookies,
"UNDEFINED" - variable is not defined,
"ANALYTICS_ONLY" - user agreed to collect essential and analytics cookies,
"PERSONALIZATION_ONLY" - user agreed to collect essential and personalization cookies.
askConsentbooleantrue if store requests customer consent to be tracked. false otherwise

Subscribe to the Ecwid.OnAPILoaded JS API event to ensure availability of this function.