As we know anyone can view our website source code and find out our Google Analytics tracking ID (UA-XXXXX-Y). And if you are open-source lover and have hosted your site openly in services like GitHub Pages then chances are anyone can knowing or unknowingly clone your site and could forget to replace tracking ID. This would seriously mislead to our overall analytics data.
So, to overcome this issue — here we will discuss few steps to do for preventing analytics data from hijacking.
You can add a filter to your profile:
- Go to:
Home > Select Site > Admin (in the bottom left-hand corner) > Filters (under “All Web Site Data”)
- Add a filter name like “Mitigate Hijacking”
- Select “Hostname” in
- Add your domain with escape character for the dot, like:
- Select “No” for
The result should look something like this:
Note: Google Analytics interface changes periodically
…for more information about view filters.