How to set up Analytics tracking for dynamic website?

Give me some hints how to set up analytics tracking for my website.

In order to set up Analytics tracking code you will need your Analytics tracking ID or tracking code snippet. Follow the steps to find them:

  1. sign in into your Google Analytics account;
  2. choose the admin tab, that is located on the top of your Analytics page;
  3. in the Account column choose necessary account from the opened menu;
  4. in opened menu in Property column choose a property;
  5. under the Property, you will find ” Tracking Info” –> “Tracking Code”. Click on it.

Setting up Analytics tracking for dynamic website.

In dynamic website the HTML page is generated by interface programming language (PHP, Python, Ruby). So, if you need to collect analytics data for your website, you have to insert the Analytics tracking code in the source code on each website page that you want to track.

When you get the Javascript tracking code snippet for your property, copy it, but DO NOT edit it and paste it into its own include file. After that insert it into the header of the page the way the tracking code snippet appears before the the closing </head> tag on each page of your website that you want to track.

If you use PHP.

Copy the Javascript tracking code snippet and add to the file “analyticstracking.php.” and after that insert this file on every PHP template page. Then at once for each template page after the opening <body> tag, add the following code: <?php include_once("analyticstracking.php") ?>

Leave a Reply

Your email address will not be published. Required fields are marked *