added google analytics support

This commit is contained in:
David Baldwynn 2016-04-24 14:34:19 -04:00
parent e1f881a336
commit 4646fb6f1e
3 changed files with 13 additions and 2 deletions

View File

@ -114,7 +114,17 @@
<p><a href="http://browsehappy.com" class="btn btn-primary btn-lg" role="button">Yes, upgrade my browser!</a></p>
</section>
<![endif] -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{google_analytics_id}}', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>

3
config/env/all.js vendored
View File

@ -2,6 +2,7 @@
module.exports = {
app: {
google_analytics_id: process.env.GOOGLE_ANALYTICS_ID || '';
title: 'TellForm',
description: 'Opensource form builder alternative to TypeForm',
keywords: 'typeform, pdfs, forms, opensource, formbuilder, google forms, nodejs',
@ -18,7 +19,7 @@ module.exports = {
},
//Sentry DSN Client Key
DSN: 'http://db01e03015ce48e2b68240ea8254b17c:5d878e9bb6c6488fbb70fb81295ee700@sentry.polydaic.com/1',
//DSN:
// The secret should be set to a non-guessable string that
// is used to compute a session hash

View File

@ -38,10 +38,10 @@ module.exports = function(db) {
});
// Setting application local variables
app.locals.google_analytics_id = config.app.oogle_analytics_id;
app.locals.title = config.app.title;
app.locals.description = config.app.description;
app.locals.keywords = config.app.keywords;
app.locals.facebookAppId = config.facebook.clientID;
app.locals.bowerJSFiles = config.getBowerJSAssets();
app.locals.bowerCssFiles = config.getBowerCSSAssets();