-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add GTM, cookiepolicy, privacypolicy
Signed-off-by: ayush-billore <[email protected]> replace chef logo with progress logo Signed-off-by: ayush-billore <[email protected]> update private policy and cookie policy Signed-off-by: ayush-billore <[email protected]> add feature flag changes Signed-off-by: ayush-billore <[email protected]> add favicon Signed-off-by: ayush-billore <[email protected]> remove favicon Signed-off-by: ayush-billore <[email protected]> remove logo and favicon changes Signed-off-by: ayush-billore <[email protected]>
- Loading branch information
1 parent
afb7f71
commit 91dd619
Showing
4 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module FeatureFlagHelper | ||
def gtm_enabled? | ||
ENV["ENABLE_GTM"] == "true" | ||
end | ||
|
||
def onetrust_enabled? | ||
ENV["ENABLE_ONETRUST"] == "true" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<% if gtm_enabled? %> | ||
<!-- Google Tag Manager conditional --> | ||
<%= javascript_tag type: "text/javascript" do %> | ||
var oneTrustHelper = (function () { | ||
function evalGTMScript() { | ||
var gtmScript = document.getElementById("GTMScript"); | ||
gtmScript.type = "text/javascript"; | ||
gtmScript.classList.remove("optanon-category-1"); | ||
eval(gtmScript.innerHTML); | ||
}; | ||
|
||
return { | ||
gtmFallback: function () { | ||
console.warn('OneTrust not loaded.'); | ||
if (document.readyState !== 'loading') { | ||
evalGTMScript(); | ||
} else { | ||
document.addEventListener('readystatechange', function () { | ||
if (document.readyState === 'interactive') { | ||
evalGTMScript(); | ||
} | ||
}); | ||
}; | ||
} | ||
}; | ||
})(); | ||
<% end %> | ||
<% end %> | ||
|
||
<% if onetrust_enabled? %> | ||
<!-- Onetrust Script --> | ||
<script async src="https://cdn.cookielaw.org/consent/e231efa5-3ed9-4b92-96bc-f4c0872ca486/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="e231efa5-3ed9-4b92-96bc-f4c0872ca486" onerror="oneTrustHelper.gtmFallback()"></script> | ||
<% end %> | ||
|
||
<% if gtm_enabled? && ENV['GTM_ID'] %> | ||
<!-- Google Tag Manager Script --> | ||
<%= javascript_tag type: "text/plain", id: "GTMScript", class: "optanon-category-1" do %> | ||
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | ||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | ||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | ||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | ||
})(window,document,'script','dataLayer','<%= ENV['GTM_ID'] %>'); | ||
<% end %> | ||
<!-- End Google Tag Manager --> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.