Reputation: 23820
I am migrating from Google Analytics (ga.js) to Universal Analytics (analytics.js). However there is no documentation about where to put this code.
Should I place it after <body>
open, or before </head>
close?
Upvotes: 1
Views: 2199
Reputation: 9603
Place it before the closing </head>
tag.
Source: Introduction to Analytics.js - Tracking Code Quick Start
To begin tracking a website using analytics.js, paste the following JavaScript snippet into your website template page so that it appears before the closing
</head>
tag. The UA-XXXX-Y, parameter must be replaced with the Web Property ID for the Google Web Property you wish to track.
Upvotes: 6