Self Managing Cookie Consent via APIs

Self Managing Cookie Consent via APIs

Cookies provide valuable insights into user interactions when used in webforms. Despite their significance, global data protection and privacy regulations, including the General Data Protection Regulation (GDPR), the ePrivacy Directive, and the Act on the Protection of Personal Information, require businesses to obtain explicit consent before using cookies that identify users. This creates a need for webforms that support cookie consent requirements and help businesses align with applicable privacy regulations.

If your website (where the webform is embedded) already has its own cookie consent banner, you can connect it to Zoho CRM to record the cookie consent choices made by your webform visitors. Read on to learn how the connection works and how to set it up correctly.

How does it work?

When a visitor accepts or rejects the cookie banner on your website, Zoho CRM does not automatically record their decision. To ensure that it accurately captures each visitor's preference, you must inform it of their choices. You can do this by adding a small piece of code that triggers when visitors make their selection.

How do I get started?

You (or your web developer) need to add the following callback functions to your cookie consent banner and trigger the appropriate one based on the visitor’s choice.
  1. If a visitor accepts cookies:
 _wfa_track.acceptCookieConsent();
  1. If a visitor rejects cookies:
_wfa_track.rejectCookieConsent();

To ensure these callback functions work correctly, trigger them only after the web form has fully loaded. Once triggered, Zoho CRM records the visitor's cookie preference. Based on this preference, analytics cookies will either continue tracking unique visits and form submissions or stop tracking them altogether.

Frequently Asked Questions

No. Even if your banner looks and works perfectly, Zoho CRM will not read or detect the visitor's choice on its own. You must use the code snippets above to notify Zoho CRM of the visitor's decision.

2. What happens if I forget to add the code to my banner?

Zoho CRM will treat every visitor as having rejected cookies by default. While this keeps you compliant, it also means that CRM will not store any cookies, so each visit and submission will be considered as new.

3. My website has more than one form — will this cause any issues?

Not necessarily, but there are a few things to keep in mind. If your website has multiple forms — for example, one using Zoho CRM's built-in cookie banner and another using your own custom banner — both can send consent signals to Zoho CRM. When two signals come from the same visitor, the most recent one overrides the earlier signal. To avoid issues, ensure your setup sends a single, clear, accurate signal that reflects the visitor's actual choice, and that conflicting signals are not sent one after the other.

4. My form is embedded via an iframe. Will my custom banner still work?

Custom cookie banners do not support forms embedded via an iframe, a method in which one webpage gets loaded inside another. In such cases, CRM will treat consent as rejected, regardless of what visitors choose on your banner. To track consent for an iFrame-embedded form, use Zoho CRM's built-in cookie consent banner instead.