{"id":147444,"date":"2025-03-21T09:44:59","date_gmt":"2025-03-21T09:44:59","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/spam-filter-insertion-tool-simo-ahavas-blog\/"},"modified":"2025-03-21T09:44:59","modified_gmt":"2025-03-21T09:44:59","slug":"spam-filter-insertion-tool-simo-ahavas-blog","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=147444","title":{"rendered":"Spam Filter Insertion Tool | Simo Ahava&#8217;s blog"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>Last weekend, I wrote a very simple web app that automatically creates a number of referral spam filters to tackle the problem that seems to have everybody all riled up.<\/p>\n<div style=\"aspect-ratio: 2878 \/ 1046;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/05\/spam-filter-installer.jpg\" title=\"Spam Filter Installer Tool\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1046\" width=\"2878\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/05\/spam-filter-installer.jpg#ZgotmplZ\" alt=\"Spam Filter Installer Tool\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>For a nice recap of the situation, take a look at <a href=\"http:\/\/www.jeffalytics.com\/google-analytics-data-quality-issue\/\">this post by Jeff Sauer<\/a>, or <a href=\"http:\/\/www.analyticsedge.com\/2014\/12\/removing-referral-spam-google-analytics\/\">this article by Mike Sullivan<\/a>.<\/p>\n<p>This isn\u2019t an opinion piece, even though I\u2019ve got a great number of opinions about this issue. If you want to read some discussion surrounding this, take a look at <a href=\"https:\/\/plus.google.com\/+StephaneHamel-immeria\/posts\/RckvNxRjF4u\">this Google+ thread<\/a>.<\/p>\n<p>(<strong>UPDATE<\/strong>: I have taken down the demo tool. You can still download the source code below if you wish, but there are <a href=\"http:\/\/help.analyticsedge.com\/spam-filter\/definitive-guide-to-removing-google-analytics-spam\/\">more robust ways<\/a> to block GA spam than creating an individual filter for each referral.)<\/p>\n<p>The tool is called the \u201cSpam Filter Insertion Tool\u201d, or SFIT for short (I dare you to start using that in your everyday lingo).<\/p>\n<p>                <span class=\"simmer\"><br \/>\n  <span class=\"close\">X<\/span><\/p>\n<p>\n    <span class=\"fa fa-md fa-bell\"\/><br \/>\n    <strong>The Simmer Newsletter<\/strong>\n  <\/p>\n<p>\n    Subscribe to the <a href=\"https:\/\/www.simoahava.com\/newsletter\/\">Simmer newsletter<\/a> to get the latest news and content from Simo Ahava into your email inbox!\n  <\/p>\n<p>  <\/span><\/p>\n<h2 id=\"download-the-source-code\">Download the source code<\/h2>\n<p>The real meat of the solution is in the <a href=\"https:\/\/github.com\/sahava\/spam-filter-tool\"><strong>GitHub repo<\/strong><\/a>.<\/p>\n<p>You can download the source code, install the application on your own web server, and use it for your own purposes.<\/p>\n<p>The application has access to the following features of the <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/config\/mgmt\/v3\/\">Google Analytics Management API<\/a>:<\/p>\n<ul>\n<li>\n<p>READ the list of accounts, properties, and profiles you have access to<\/p>\n<\/li>\n<li>\n<p>INSERT or UPDATE profile filters on the account level<\/p>\n<\/li>\n<li>\n<p>INSERT profile filter links, which attach the newly-created or updated filters to the selected profiles<\/p>\n<\/li>\n<\/ul>\n<p>To get it up and running, you will need to register a new project in the <a href=\"https:\/\/console.developers.google.com\/\">Google Developers Console<\/a>, create a new Client ID for a web application, as well as a public API key. Remember to activate the Google Analytics API as well!<\/p>\n<h2 id=\"how-it-works\">How it works<\/h2>\n<p>When you click <strong>Initialize<\/strong>, the tool requests your authentication to do all sorts of horrible things to your GA account. Do not worry! This tool mainly only INSERTs and READs. The only exception is if you already have these spam filters installed on your GA account, but they are outdated, in which case the tool will automatically update them to their newest versions!<\/p>\n<p>Once you\u2019ve authenticated your account, you will be served a drop-down menu from which you can <strong>choose any GA account you have EDIT access to<\/strong>. Why EDIT access? Because that\u2019s the required access level for new filter creation. You read that right! To create filters, you need EDIT access on the account level.<\/p>\n<div style=\"aspect-ratio: 2052 \/ 568;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/05\/accounts-properties-profiles.jpg\" title=\"Accounts, properties and profiles selection\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"568\" width=\"2052\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/05\/accounts-properties-profiles.jpg#ZgotmplZ\" alt=\"Accounts, properties and profiles selection\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Anyhow, choose an account and the tool should shortly load with a multiple selection menu, where you can pick the profiles to which you want to link the filters.<\/p>\n<p>Once you click the <strong>Create and apply filters<\/strong>, the tool does just that. First, it creates the filters on the account level, after which it links each filter to the profiles you selected.<\/p>\n<p>The list of filters is the one maintained in <a href=\"https:\/\/lonegoatuk.tumblr.com\/post\/107307494431\/google-analytics-referral-spambot-list\">this Lone Goat resource<\/a>. Whenever they update the list, I update these filters. Which brings me to the\u2026<\/p>\n<h2 id=\"caveats\">Caveats<\/h2>\n<p><strong>These filters only help with referral spam<\/strong>. They will not help you with polluted Measurement Protocol hits, or with spam that doesn\u2019t come in as referral traffic, or with spam that comes in as referral traffic but isn\u2019t in the filters yet. There are many methods to combat this issue, and you might want to check the couple of links I had in the very beginning for ideas.<\/p>\n<p>Anyway, feel free to use the tool and let me know if there are issues.<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Last weekend, I wrote a very simple web app that automatically creates a number of referral spam filters to tackle the problem that seems to have everybody all riled up. For a nice recap of the situation, take a look at this post by Jeff Sauer, or this article by Mike Sullivan. This isn\u2019t an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":147445,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[27402,3767,9981,43632,27401,16081,1447],"dealstore":[],"offerexpiration":[],"class_list":["post-147444","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-ahavas","tag-blog","tag-filter","tag-insertion","tag-simo","tag-spam","tag-tool"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spam Filter Insertion Tool | Simo Ahava&#039;s blog - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=147444\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spam Filter Insertion Tool | Simo Ahava&#039;s blog - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Last weekend, I wrote a very simple web app that automatically creates a number of referral spam filters to tackle the problem that seems to have everybody all riled up. For a nice recap of the situation, take a look at this post by Jeff Sauer, or this article by Mike Sullivan. This isn\u2019t an [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=147444\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-21T09:44:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/spam-filter-installer-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"930\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=147444#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=147444\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Spam Filter Insertion Tool | Simo Ahava&#8217;s blog\",\"datePublished\":\"2025-03-21T09:44:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=147444\"},\"wordCount\":607,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=147444#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/spam-filter-installer-scaled.jpg\",\"keywords\":[\"Ahavas\",\"Blog\",\"Filter\",\"insertion\",\"Simo\",\"SPAM\",\"Tool\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=147444#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=147444\",\"url\":\"https:\/\/fivemor.com\/?p=147444\",\"name\":\"Spam Filter Insertion Tool | Simo Ahava's blog - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=147444#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=147444#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/spam-filter-installer-scaled.jpg\",\"datePublished\":\"2025-03-21T09:44:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=147444#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=147444\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=147444#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/spam-filter-installer-scaled.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/spam-filter-installer-scaled.jpg\",\"width\":2560,\"height\":930},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=147444#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spam Filter Insertion Tool | Simo Ahava&#8217;s blog\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spam Filter Insertion Tool | Simo Ahava's blog - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=147444","og_locale":"en_US","og_type":"article","og_title":"Spam Filter Insertion Tool | Simo Ahava's blog - Som2ny Network","og_description":"Last weekend, I wrote a very simple web app that automatically creates a number of referral spam filters to tackle the problem that seems to have everybody all riled up. For a nice recap of the situation, take a look at this post by Jeff Sauer, or this article by Mike Sullivan. This isn\u2019t an [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=147444","og_site_name":"Som2ny Network","article_published_time":"2025-03-21T09:44:59+00:00","og_image":[{"width":2560,"height":930,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/spam-filter-installer-scaled.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=147444#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=147444"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Spam Filter Insertion Tool | Simo Ahava&#8217;s blog","datePublished":"2025-03-21T09:44:59+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=147444"},"wordCount":607,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=147444#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/spam-filter-installer-scaled.jpg","keywords":["Ahavas","Blog","Filter","insertion","Simo","SPAM","Tool"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=147444#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=147444","url":"https:\/\/fivemor.com\/?p=147444","name":"Spam Filter Insertion Tool | Simo Ahava's blog - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=147444#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=147444#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/spam-filter-installer-scaled.jpg","datePublished":"2025-03-21T09:44:59+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=147444#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=147444"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=147444#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/spam-filter-installer-scaled.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/spam-filter-installer-scaled.jpg","width":2560,"height":930},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=147444#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Spam Filter Insertion Tool | Simo Ahava&#8217;s blog"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/147444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=147444"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/147444\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/147445"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=147444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=147444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=147444"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=147444"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=147444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}