This presi covers how to remove spam/ghost referral traffic in Google Analytics using Google tag Manager
Thanks for GTMtraining.com for creating a great video tutorial as well.
3. First let’s replicate that junk
Go to https://ga-dev-
tools.appspot.com/hit-builder/
1. Set client GA id in the tid field
2. Autogenerate the cid
3. Add 2 parameters
Name= dp value= /
Name= dr value= http://spam.com
Open GA realtime overview
8. 1. Choose More and then
click New
2. Title it LandingPage
3. Choose Page View for
event and trigger
4. Choose Some page views
5. Set referrer>does not
contain> yourdomain.com
6. Click Create Trigger
7. Click Create Tag
Create New Trigger continuing where
you left off in GTM
9. Confirm that Tag is Firing
1. Enter debug mode from
dropdown under Publish
2. Enter client site thru
Google Search and check
for tag in bottom pane
3. Go into developer mode
(press CTRL+Shift+I)
1. Under Resources choose
cookies then client
domain
2. Look for dev cookie
10. Create a New Variable in GTM
1. Choose Variables in GTM
then scroll to bottom to
select new user defined
variable
2. Title it “dev cookie”
3. Choose 1st party cookie
4. Title the variable “dev”
5. Click create variable
6. Refresh Debug Mode
7. Refresh Client url and go to
the tag manager pane at
bottom
8. Find the dev cookie under
pageview then variables
11. Let’s Create a Custom Dimension in
GA1. Go to Client GA Admin
View> Property
Column choose
Custom
Definitions>Choose
Custom Dimensions
2. Select New Custom
Dimension
3. Name it “dev”
4. Set Scope to User
5. Ensure Active and
Create
6. Pay attention to
dimension number
1. Likely will be 1
12. Include Dimension in Client GTM Analytics Tag
1. Choose the analytics
tag firing on all pages
2. Edit Configure Tag
section
3. Select More
Settings>Custom
Dimensions
4. Enter value from GA
(likely 1) and set value
to dev cookie.
5. Continue>Save tag
13. Check that Variable
1. Refresh your GTM Debug Mode
and Client Site
2. Using Google Tag Assistant
Select the Analytics Tag
3. Select Pageview requests
4. Select Custom Metrics
5. Check for your custom
dimension
14. Create Filter in GA
1. Under Client GA Admin go to Views
and Create a Test View
2. Create new filter in the new view
3. Title it “include cookied data”
4. Choose custom
5. Set to Include
6. Filter field search “dev” and select it
7. Set pattern to “notset”
8. Save.
9. Go to the new view realtime
reporting. Resend the spam hit with
the hitbuilder from earlier. It should
not appear. Can also check main view
to see if spam hit shows. If working
apply filter to the main GA view.