Skip to main content

Cookie Consent Integration

OneTap Login includes built-in integration with cookie consent plugins to ensure GDPR compliance. The plugin can detect user consent before displaying the Google sign-in features.

Google Sign-In uses cookies for authentication. Under GDPR and similar regulations:

  • Users must consent before non-essential cookies
  • Google authentication cookies may require consent
  • Displaying sign-in without consent could be non-compliant
Regional Requirements

Cookie consent is primarily required for:

  • EU (GDPR)
  • UK (UK GDPR)
  • California (CCPA - limited)
  • Brazil (LGPD)
  • Other jurisdictions with similar laws

Configuration Options

Accessing Settings

  1. Go to Settings > OneTap Login
  2. Find Cookie Consent section in General tab

Settings Cookie Consent Dropdown

Available Modes

ModeBehaviorUse Case
DisabledAlways show Google sign-inNon-EU sites, no consent needed
Auto-detectDetect consent plugins, wait for consentMost sites with consent plugins
Always requireAlways require consent, even without pluginMaximum compliance

Disabled Mode

Respect cookie consent: Disabled

Behavior:

  • One Tap popup shows immediately
  • Sign-in button always visible
  • No consent checking

Use when:

  • Your site doesn't require cookie consent
  • You're not targeting EU/UK users
  • Google login is considered "essential"
Respect cookie consent: Auto-detect

Behavior:

  1. Plugin checks for supported consent plugins
  2. If found, waits for user consent
  3. Shows Google sign-in only after consent given
  4. If no consent plugin, shows immediately

Use when:

  • You have a cookie consent plugin installed
  • You want automatic GDPR compliance
  • You need flexibility for different setups

Always Require Mode

Respect cookie consent: Always require

Behavior:

  • Always waits for consent signal
  • Won't show Google sign-in without explicit consent
  • Works even without consent plugin (via WP Consent API)

Use when:

  • Maximum compliance required
  • Legal team recommends explicit consent
  • Highly regulated industries

OneTap Login auto-detects these 9 consent plugins:

1. CookieBot (Cybot)

Plugin: CookieBot

Detection method: window.Cookiebot object

Consent check:

Cookiebot.consent.marketing === true

Category: Marketing cookies

2. Complianz

Plugin: Complianz GDPR/CCPA

Detection method: cmplz_* cookies

Consent check:

cmplz_has_consent('marketing')

Category: Marketing cookies

Cookie Consent Complianz

Plugin: GDPR Cookie Consent

Detection method: CLI_* functions

Consent check:

CLI.consent.marketing === true

Category: Marketing/Targeting cookies

Plugin: Cookie Notice

Detection method: cookie_notice_accepted cookie

Consent check:

document.cookie.includes('cookie_notice_accepted=true')

Category: All cookies (single consent)

5. CookieYes

Plugin: CookieYes

Detection method: window.ckyAllowCategory function

Consent check:

ckyAllowCategory('analytics')

Category: Analytics cookies

6. Iubenda

Plugin: Iubenda Cookie Solution

Detection method: _iub.cs object

Consent check:

_iub.cs.consent.purposes[4] === true

Category: Purpose 4 (Advertising)

7. OneTrust/CookiePro

Plugin: OneTrust

Detection method: OneTrust object

Consent check:

OneTrust.IsActiveGroup('C0004')

Category: C0004 (Targeting cookies)

8. Termly

Plugin: Termly

Detection method: Termly object

Consent check:

Termly.getConsentState().advertising

Category: Advertising cookies

Plugin: WP Consent API

Detection method: wp_has_consent function

Consent check:

wp_has_consent('marketing')

Category: Marketing cookies

How Auto-Detection Works

Detection Flow

Page Load

Check for consent plugin → Not found → Show Google Sign-In
↓ Found
Check user consent status → Consented → Show Google Sign-In
↓ Not consented
Hide Google Sign-In → Wait for consent event
↓ User gives consent
Show Google Sign-In

Google Sign-In typically falls under:

PluginRequired Category
CookieBotMarketing
ComplianzMarketing
GDPR Cookie ConsentMarketing/Targeting
Cookie Notice(any consent)
CookieYesAnalytics
IubendaPurpose 4
OneTrustC0004
TermlyAdvertising
WP Consent APIMarketing

Event Listeners

The plugin listens for consent events:

// CookieBot
window.addEventListener('CookiebotOnAccept', showGoogleSignIn);

// Complianz
document.addEventListener('cmplz_status_change', checkConsent);

// Generic
document.addEventListener('consent_updated', checkConsent);

Configuration Examples

EU E-commerce Store

Respect cookie consent: Auto-detect
Consent plugin: Complianz (or similar)

This setup:

  1. Detects Complianz on page load
  2. Checks if marketing cookies accepted
  3. Shows Google sign-in only after consent

US-Only Store

Respect cookie consent: Disabled

This setup:

  • Shows Google sign-in immediately
  • No consent checking
  • Simpler user experience

Multi-Region Store

Respect cookie consent: Auto-detect
Consent plugin: CookieBot with geolocation

This setup:

  • CookieBot handles geolocation
  • Consent shown only to EU users
  • Google sign-in waits for EU, shows immediately for others

Maximum Compliance

Respect cookie consent: Always require
Consent plugin: OneTrust

This setup:

  • Always requires explicit consent
  • Most restrictive approach
  • Recommended for healthcare, finance, etc.

Troubleshooting

Sign-In Never Appears

Symptom: Google sign-in doesn't show even after consent

Solutions:

  1. Check if consent plugin is properly detecting consent
  2. Verify the correct cookie category is accepted
  3. Test in incognito with fresh consent
  4. Check browser console for errors

Symptom: Google sign-in shows without user consent

Solutions:

  1. Verify "Auto-detect" or "Always require" is selected
  2. Check if consent plugin is properly installed
  3. Ensure consent plugin JavaScript loads before OneTap
  4. Clear all caches (browser, WordPress, CDN)

Symptom: Consent for one category doesn't enable sign-in

Solutions:

  1. Verify which category Google cookies are classified as
  2. Some consent plugins allow category customization
  3. Contact consent plugin support for category mapping

Plugin Not Detected

Symptom: "No consent plugin detected" even with one installed

Solutions:

  1. Ensure consent plugin is activated
  2. Check for JavaScript errors preventing detection
  3. Verify consent plugin version is current
  4. Some plugins need specific settings enabled

Manual Testing Steps

  1. Clear cookies - Start fresh
  2. Visit site - Consent banner should appear
  3. Verify hidden - Google sign-in should not be visible
  4. Accept cookies - Click accept on consent banner
  5. Verify shown - Google sign-in should now appear

Browser Console

Check detection status:

// Type in browser console
console.log('OneTap consent status:', window.onetap_consent_status);

Debug Mode

Enable WordPress debug mode:

// wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

Check /wp-content/debug.log for consent-related messages.

If your consent plugin isn't supported, use WP Consent API:

  1. Install WP Consent API
  2. Configure your consent plugin to integrate with it
  3. Set OneTap Login to "Auto-detect" or "Always require"

Custom JavaScript Hook

For advanced custom integration:

// Your consent handler
function onConsentGiven() {
// Trigger OneTap Login to check consent again
if (window.onetap_check_consent) {
window.onetap_check_consent();
}
}

Best Practices

Do's

  • Test consent flow thoroughly before launch
  • Use auto-detect for most setups
  • Keep consent plugin updated
  • Document your consent categories
  • Verify mobile consent flow

Don'ts

  • Don't disable consent for EU users
  • Don't assume consent without checking
  • Don't forget to test after updates
  • Don't ignore consent plugin documentation

GDPR Compliance Checklist

  • Cookie consent plugin installed and configured
  • OneTap Login set to "Auto-detect" or "Always require"
  • Google Sign-In categorized correctly in consent plugin
  • Consent banner clearly explains cookie usage
  • Privacy policy mentions Google Sign-In
  • Tested consent flow on desktop and mobile
  • Tested with cookies cleared

Next Steps