Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
set FT tracking env to 't' in test/dev, or 'p' for production build
Browse files Browse the repository at this point in the history
  • Loading branch information
callumlocke committed Dec 9, 2015
1 parent fa1d878 commit a3ae6b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/top.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
ga('send', 'pageview');
</script>
<script>
var FT = FT || {}; FT.Properties = FT.Properties || {}; FT.Properties.ENV = 't'; // For Prod OR
var FT = FT || {}; FT.Properties = FT.Properties || {}; FT.Properties.ENV = '{{#if trackingEnv}}{{trackingEnv}}{{else}}t{{/if}}';
</script>
<!-- FT tracking module 1.2.5 -->
<script src="https://h2.ft.com/static-render-p.ft.com/scripts/a03ca392/bundles/tracking.js"></script>
Expand Down
6 changes: 5 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ gulp.task('templates', () => {
const homewords = JSON.parse(fs.readFileSync('client/homewords.json', 'utf8'));

const mainPageTemplate = Handlebars.compile(fs.readFileSync('client/main-page.hbs', 'utf8'));
const mainPageHtml = mainPageTemplate({homewords, words});
const mainPageHtml = mainPageTemplate({
trackingEnv: (env === 'production' ? 'p' : 't'),
homewords,
words,
});
fs.writeFileSync(`.tmp/index.html`, mainPageHtml);
});

0 comments on commit a3ae6b5

Please sign in to comment.