Skip to content

Commit

Permalink
temp: Check cohesionConfig access from htmlWebpackPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
julianajlk committed Nov 6, 2024
1 parent 4493f8d commit 0d212f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cohesion.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const cohesionConfig = {
postTypeGql: '',
homepageGql: '',
siteUrl: process.env.MARKETING_SITE_BASE_URL,
cmsUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL || '',
cmsUser: process.env.WP_USER || '',
cmsPwd: process.env.WP_PWD || '',
cmsUrl: '',
cmsUser: '',
cmsPwd: '',
logoUrl: '',
studyMatchUrl: '',
voyagerUrl: '/discover',
Expand Down
19 changes: 13 additions & 6 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@
<script src="https://www.edx.org/optimizelyjs/<%= htmlWebpackPlugin.options.OPTIMIZELY_PROJECT_ID %>.js"></script>
<% } %>

<% /* TEMP: testing cohesionConfig access */ %>
<script>
if (htmlWebpackPlugin && htmlWebpackPlugin.options && htmlWebpackPlugin.options.cohesionConfig) {
console.log('htmlWebpackPlugin attribute exists', htmlWebpackPlugin.options.cohesionConfig.tagularDomainWhitelist);
} else {
console.log('htmlWebpackPlugin attribute does not exists');
}
</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};
Expand All @@ -34,17 +42,16 @@
(window,document,'cohesion','preamp','fuse','tagular',{
tagular: {
apiHost: 'https://beam.edx.org/v2/t',
writeKey: '<%= htmlWebpackPlugin.options.cohesionConfig.tagularWriteKey %>',
sourceKey: '<%= htmlWebpackPlugin.options.cohesionConfig.tagularSourceKey %>',
cookieDomain: '<%= htmlWebpackPlugin.options.cohesionConfig.tagularCookieDomain %>',
domainWhitelist: <%= htmlWebpackPlugin.options.cohesionConfig.tagularDomainWhitelist %>,
writeKey: 'wk_2euJfDkJVTtEVzsC8BPOb0g9dVj',
sourceKey: 'src_2euJfAVNt6Z9kQz4e9t1SQBtm8x',
cookieDomain: 'edx.org',
domainWhitelist: '['edx.org']',
apiVersion: 'v2/t',
multiparty: true,
taggy: { enabled: true },
}
})`}
</script>
<% } %>
</head>
<body>
<div id="root">
Expand Down

0 comments on commit 0d212f8

Please sign in to comment.