Skip to content

Commit

Permalink
Merge pull request #1466 from habitat-sh/rk/add-segment-snippet
Browse files Browse the repository at this point in the history
Approved by: @nobody from Nowhere
Merged by: The Sentinels
  • Loading branch information
thesentinels authored Nov 9, 2016
2 parents e53b017 + 767e3b9 commit 9690192
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/builder-web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5VR24H');</script>
<!-- End Google Tag Manager -->
<!-- Segment -->
<script type="text/javascript">!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("NAwVPW04CeESMW3vtyqjJZmVMNBSQ1K1");analytics.page();}}();</script>
<!-- End Segment -->
<hab>
<script>
window.Habitat = { config: {} };
Expand Down
3 changes: 3 additions & 0 deletions www/source/layouts/_segment.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- Segment -->
<script type="text/javascript">!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("NAwVPW04CeESMW3vtyqjJZmVMNBSQ1K1");analytics.page();}}();</script>
<!-- End Segment -->
1 change: 1 addition & 0 deletions www/source/layouts/layout.slim
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ html prefix="og: http://ogp.me/ns#"

body class="#{current_page.data.classes} #{layout_class}"
= partial "layouts/gtm"
= partial "layouts/segment"

= partial "layouts/nav"

Expand Down

0 comments on commit 9690192

Please sign in to comment.