Google Analytics
Google Analytics allows you to track visitors on your site, and generate reports that will help you manage your site efficiently.
Before You Begin
In general, Google Analytics should only be enabled once, otherwise tracking will be inaccurate. Before you try to set up Google Analytics, you should make sure that it isn't already enabled on your site. If you're sure that Google Analytics isn't enabled yet for your site, and if you're already have a Google account yo want to use for analytics tracking, you can skip ahead to set up Universal Analytics.
Get A Google Account
Before you can enable Google Analytics, you'll need a Google account. If you already have a GMail account, you'll be able to use that. If not, create your Google account here. You don't have to use the GMail account for anything other than signing in and out of Google Analytics.
Universal Analytics
To enable Google Analytics:
- Navigate to Google Analytics homepage and click Sign in.
- Click Analytics in the dropdown menu.
- Choose the account you want to sign in with, or click Add account to sign in with a new Google account.
- On the next page, click on Sign Up button and choose Website. Fill up the required information. Enter your primary domain for the Web Site URL. The checkboxes at the bottom are not relavant, so uncheck them all.
- Click Get Tracking ID button at the bottom of the page to complete sign up.
On the next page, you'll see a lot of information and options. The only things you need is the tracking ID that Google provides:
(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','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-########-#', 'yourwebsite.com'); ga('send', 'pageview');- Copy the tracking ID to your clipboard by higlighting it and pressing ctrl + C on PC or command + C on Mac. You will need this tracking ID
UA-########-#only. You don't need to copy the whole<scripts>or</script>snippet.