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:
Filters
Home > Select Site > Admin (in the bottom left-hand corner) > Filters (under “All Web Site Data”) - Click
New Filter
- Add a filter name like “Mitigate Hijacking”
- Click
Custom Filter
- Click
Include
- Select “Hostname” in
Filter Field
- Add your domain with escape character for the dot, like:
example\.com
- Select “No” for
Case Sensitive
The result should look something like this:
Note: Google Analytics interface changes periodically
…for more information about view filters.