-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cookie policy, privacy policy, logo and favicon changes
Signed-off-by: ayush-billore <[email protected]>
- Loading branch information
1 parent
2b8af23
commit d1a9a32
Showing
3 changed files
with
12 additions
and
95 deletions.
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 |
---|---|---|
@@ -1,13 +1,5 @@ | ||
module FeatureFlagHelper | ||
def gtag_enabled? | ||
ENV["ENABLE_GTAG"] == "true" | ||
end | ||
|
||
def gtm_enabled? | ||
ENV["ENABLE_GTM"] == "true" | ||
end | ||
|
||
def onetrust_enabled? | ||
ENV["ENABLE_ONETRUST"] == "true" | ||
def air_gapped? | ||
ENV["AIR_GAPPED"] == "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 |
---|---|---|
@@ -1,91 +1,20 @@ | ||
<% if gtm_enabled? %> | ||
<!-- Google Tag Manager conditional --> | ||
<%= javascript_tag nonce: content_security_policy_nonce 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? %> | ||
<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 --> | ||
<%= 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 %> | ||
|
||
<% if gtag_enabled? %> | ||
<!-- GTag conditional --> | ||
<% if ENV['SEGMENT_WRITE_KEY'] %> | ||
<%= javascript_tag nonce: content_security_policy_nonce do %> | ||
var oneTrustHelper = (function () { | ||
function evalGTagScript() { | ||
var gtScript = document.getElementById("GTagScript"); | ||
gtScript.type = "text/javascript"; | ||
gtScript.classList.remove("optanon-category-2"); | ||
eval(gtScript.innerHTML); | ||
}; | ||
return { | ||
gtagFallback: function () { | ||
console.warn('OneTrust not loaded.'); | ||
if (document.readyState !== 'loading') { | ||
evalGTagScript(); | ||
} else { | ||
document.addEventListener('readystatechange', function () { | ||
if (document.readyState === 'interactive') { | ||
evalGTagScript(); | ||
} | ||
}); | ||
}; | ||
} | ||
}; | ||
})(); | ||
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0"; | ||
analytics.load("<%= ENV["SEGMENT_WRITE_KEY"] %>"); | ||
analytics.page(); | ||
}}(); | ||
<% end %> | ||
<% end %> | ||
|
||
<% if gtag_enabled? && ENV['GOOGLE_ANALYTICS_ID'] %> | ||
<% if ENV['GOOGLE_ANALYTICS_ID'] %> | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= ENV['GOOGLE_ANALYTICS_ID'] %>"></script> | ||
<%= javascript_tag nonce: content_security_policy_nonce do %> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){window.dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', '<%= ENV['GOOGLE_ANALYTICS_ID'] %>'); | ||
<% end %> | ||
<% end %> | ||
|
||
<% if ENV['SEGMENT_WRITE_KEY'] %> | ||
<%= javascript_tag nonce: content_security_policy_nonce do %> | ||
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0"; | ||
analytics.load("<%= ENV["SEGMENT_WRITE_KEY"] %>"); | ||
analytics.page(); | ||
}}(); | ||
gtag('config', '<%= ENV['GOOGLE_ANALYTICS_ID'] %>'); | ||
<% 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