Skip to content

Commit c94a01d

Browse files
Merge pull request #196 from woocommerce/add/google-analytics-tracking
Add Google Analytics tracking to layout.
2 parents 7602d65 + 3c4bbc9 commit c94a01d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: source/layouts/layout.erb

+9
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ under the License.
4646
<% else %>
4747
<%= javascript_include_tag "all_nosearch" %>
4848
<% end %>
49+
<!-- Global site tag (gtag.js) - Google Analytics -->
50+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-8KCYZ2CYMS"></script>
51+
<script>
52+
window.dataLayer = window.dataLayer || [];
53+
function gtag(){dataLayer.push(arguments);}
54+
gtag('js', new Date());
55+
56+
gtag('config', 'G-8KCYZ2CYMS');
57+
</script>
4958
</head>
5059

5160
<body class="<%= page_classes %><% if current_page.data.warning %> has-warning<% end %>" data-languages="<%=h language_tabs.map{ |lang| lang.is_a?(Hash) ? lang.keys.first : lang }.to_json %>">

0 commit comments

Comments
 (0)