Integrating Your Actions

This page shows how you can integrate your actions for event handling.

Event Handling:

Name

Description

GdprCookieConsentOnLoad

The event is triggered when the cookie banner has loaded to get the user's consent.

GdprCookieConsentOnAccept

The event is triggered if the user accepts the use of cookies.

GdprCookieConsentOnReject

The event is triggered if the user declines the use of cookies by clicking the reject-button in the cookie consent dialog.

GdprCookieConsentOnOptout

The event is triggered when user optouts for Do not sell my personal information

GdprCookieConsentOnCancelOptout

The event is triggered when user rejects CCPA notice to do not sell my personal information

Examples:

  1. Load marketing cookies if the user has accepted:

<script type="text/javascript">
window.addEventListener('GdprlCookieConsentOnAccept', function (e) {
        if(e.detail.wpl_viewed_cookie == 'yes') {
        	if(e.detail.wpl_user_preference.marketing == 'yes') {
                // Execute code that sets marketing cookies.
            }
        }
}, false);
</script>

2. Load Google Analytics if the user has accepted Cookies:

3. PHP Code:

Last updated

Was this helpful?