Get Started: AI Resources for Oracle Cloud HCM – Go Here
Progress with Redwood: Redwood Resources for Oracle Cloud HCM - Go Here
Progress with Redwood: Redwood Resources for Oracle Cloud HCM - Go Here
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());
Tagged:
1