Things you will need
- Google Analytics Account
Step 1- Handling Google Analytics tracking code
You need to have Google Analytics code. You can ignore step-1 if you have Google Analytics code else if you don’t have you can learn and can get by following below instruction-
- Login to your Google Analytics Account (http://www.google.co.in/analytics/).
- Choose the website for which you the Analytics code.
- Click on the Admin tab and then under the Property Column Click on Tracking Info and select Tracking code option
ga('create', 'UA-123456789-1', 'yourwebsite.com');
- Copy your Google Analytics Tracking ID, you can get this from the tracking code provided by the Google Analytics account (See the first step if you need help). It is in the following format UA-123456789-1, for reference see the above example.
- Replace “Your Site tracking here” below with your tracking ID and yourwebsite.com with your domain name.
<noscript><img src="http://nojsstats.appspot.com/Your Site tracking here/yourwebsite.com"/></noscript>
|tid||Your GA tracking ID in format UA-123456-XX|
|z||Any random string to prevent the browser caching. You can use the PHP rand() function to generate a random string.|
|v||Google analytics version by default, it should 1|
|t||Events to be tracked by default it should be the event|
|ea||Encoded URL that to be tracked; you can use urlencode() in case of PHP|