Skip to content

Commit

Permalink
feat: Add cohesion snippet to index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
julianajlk committed Oct 17, 2024
1 parent 1a22a2b commit a67a3c0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,33 @@
<% if (htmlWebpackPlugin.options.OPTIMIZELY_PROJECT_ID) { %>
<script src="https://www.edx.org/optimizelyjs/<%= htmlWebpackPlugin.options.OPTIMIZELY_PROJECT_ID %>.js"></script>
<% } %>

<% /* NOTE: Adding Red Ventures related cohesion/tagular code for the launch of the new marketing website. */ %>
<% if (htmlWebpackPlugin.options.cohesionConfig) { %>
<script>
{`!function(co,h,e,s,i,o,n){var d='documentElement';var a='className';h[d][a]+=' preampjs';
n.k=e;co._Cohesion=n;co._Preamp={k:s,start:new Date};co._Fuse={k:i};co._Tagular={k:o};
[e,s,i,o].map(function(x){co[x]=co[x]||function(){(co[x].q=co[x].q||[]).push([].slice.call(arguments))}});
var b=function(){var u=h[d][a];h[d][a]=u.replace(/ ?preampjs/g,'')};
h.addEventListener('DOMContentLoaded',function(){co.setTimeout(b,3e3);
co._Preamp.docReady=co._Fuse.docReady=!0});var z=h.createElement('script');
z.async=1;z.src='https://content.cmn.com/cohesion/cohesion-latest.min.js';
z.onerror=function(){var ce='error',f='function';for(var o of co[e].q||[])o[0]===ce&&typeof o[1]==f&&o[1]();co[e]=function(n,cb){n===ce&&typeof cb==f&&cb()};b()};
h.head.appendChild(z);}
(window,document,'cohesion','preamp','fuse','tagular',{
tagular: {
apiHost: 'https://content.cmn.com/v2/t',
writeKey: '<%= htmlWebpackPlugin.options.cohesionConfig.tagularWriteKey %>',
sourceKey: '<%= htmlWebpackPlugin.cohesionConfig.tagularSourceKey %>',
cookieDomain: '<%= htmlWebpackPlugin.cohesionConfig.tagularCookieDomain %>',
domainWhitelist: <%= htmlWebpackPlugin.cohesionConfig.tagularDomainWhitelist %>,
apiVersion: 'v2/t',
multiparty: true,
taggy: { enabled: true },
}
})`}
</script>
<% } %>
</head>
<body>
<div id="root">
Expand Down

0 comments on commit a67a3c0

Please sign in to comment.