Skip to content

How to Test Google Analytics on Localhost

google analytics

We will explain you step by step guide how to test google analytics tool on your localhost pc or laptop. Are you a web analyst or a webmaster or a developer and looking for google analytics solutions. SoniSEO provides you wide range of how to tips on Google analytics and other web analytics tools.

Here is the step by Step Tips how to use google analytics on localhost

Step 1 Signup for Google Analytics if already signed up login to your google analytics account.

Step 2 Create New Account and property in Google Analytics and give name whatever you want.

Step 3 Now the enter main part of your analytics localhost default URL. This default URL will be your localhost IP.

If you are not aware of your localhost IP. You can find it in your PCs’s – C Drive >> Windows>> System32 >> Drivers >> ETC >> hosts

Open this hosts file and check IP now access this IP in your web browser. Is your localhost website accesible by this IP? example http://127.0.0.1/demowebsite/. This IP setting may differs depends on IIS or Apache. Now note this IP

Step 4 Create default view and get tracking code

Step 5 Edit tracking code and set it in auto mode Example – ga(‘create’, ‘UA-xxxxxx-x’, ‘auto’);

Step 6 Now put this tracking code in your localhost website’s <head> </head> section.

Now your localhost website is ready for reporting.

Tags: