Get Started with Redwood for Oracle Cloud HCM Begin Now
To ensure that questions get required attention from community members and are NOT left unanswered, it’s important for the author to indicate (by selecting “Yes” or “No” when prompted) whether the question was answered. (newly added) Please note that it is also important to respond to EACH comment your question receives. Your Yes or No response ensures an accurate status for your question.
For more information, please refer to this announcement explaining best practices for getting answers to questions.
For more information, please refer to this announcement explaining best practices for getting answers to questions.
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