You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to use cookieAccept cookie value in ORC javascript to enable/disable Google Analytics?

Summary:

We tried using the response from this question (https://community.oracle.com/customerconnect/discussion/comment/860438) into the javascript section in ORC but were unsuccessful in disabling Google Analytics if the user's cookie choice was disabled.

Content (please ensure you mask any confidential information):


Version (include the version you are using, if applicable):


Code Snippet (add any code snippets that support your topic, if applicable):

if(CX_CONFIG.app.cookieConsent.cookieMessageEnabled)

{

window.alert(CX_#_cookieAccept);

var script = document.createElement('script');

script.src = <GA_link>;

document.head.appendChild(script);


window.dataLayer = window.dataLayer || [];


function gtag(){dataLayer.push(arguments);}

gtag('js', new Date());

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!