{"id":930,"date":"2013-07-16T14:40:08","date_gmt":"2013-07-16T02:40:08","guid":{"rendered":"http:\/\/www.funk.co.nz\/blog\/?p=930"},"modified":"2013-07-17T16:56:42","modified_gmt":"2013-07-17T04:56:42","slug":"ga-bug-internal-site-search-tracking-doesnt-work-with-urls-rewritten-by-filter","status":"publish","type":"post","link":"https:\/\/www.funk.co.nz\/blog\/online-marketing\/google-analytics\/ga-bug-internal-site-search-tracking-doesnt-work-with-urls-rewritten-by-filter","title":{"rendered":"GA Bug: Internal Site Search tracking doesn't work with URLs rewritten by filter"},"content":{"rendered":"<p>So I thought I was being cunning by putting in a filtered profile which would have an advanced custom filter to re-write incoming URLs into the format expected by GA site search tracking.<\/p>\n<p>But it doesn't work.<\/p>\n<p>Here's the incoming URLs that won't track:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-931\" title=\"Before URL Rewrites\" src=\"https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/before.png\" alt=\"Before URL Rewrites\" width=\"888\" height=\"468\" srcset=\"https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/before.png 888w, https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/before-600x316.png 600w, https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/before-650x342.png 650w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><\/p>\n<p>And here is the after they are rewritten, all nice and tidy with just the keyword:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-932\" title=\"After URL Rewrites\" src=\"https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/after.png\" alt=\"After URL Rewrites\" width=\"310\" height=\"344\" \/><\/p>\n<p>However, with site search tracking enabled, nothing is showing in the site search report.<\/p>\n<p>Here is the filter config:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-933\" title=\"Filter Order\" src=\"https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/filter-order.png\" alt=\"Filter Order\" width=\"608\" height=\"114\" srcset=\"https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/filter-order.png 608w, https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/filter-order-600x113.png 600w\" sizes=\"auto, (max-width: 608px) 100vw, 608px\" \/><\/p>\n<p>And the URL Rewrites are done with regex:\u00c2\u00a0\/search\/jobs\/(.*)\\?job<\/p>\n<p>The capture group is output to a Request URI like this:\u00c2\u00a0\/\\?q=$A1<\/p>\n<p>But perhaps the Internal Site Search tracking is applied before the filters: which is a bug right?<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-934\" title=\"Filter Config\" src=\"https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/filter-config.png\" alt=\"Filter Config\" width=\"662\" height=\"492\" srcset=\"https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/filter-config.png 662w, https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/filter-config-600x446.png 600w, https:\/\/www.funk.co.nz\/blog\/wp-content\/uploads\/2013\/07\/filter-config-650x483.png 650w\" sizes=\"auto, (max-width: 662px) 100vw, 662px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Thanks to <a title=\"Student Job Search\" href=\"http:\/\/www.sjs.co.nz\/\" target=\"_blank\">Student Job Search<\/a> for allowing me to publish this blog.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I thought I was being cunning by putting in a filtered profile which would have an advanced custom filter to re-write incoming URLs into the format expected by GA site search tracking. But it doesn&#8217;t work. Here&#8217;s the incoming URLs that won&#8217;t track: And here is the after they are rewritten, all nice and [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-930","post","type-post","status-publish","format-standard","hentry","category-google-analytics"],"_links":{"self":[{"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/posts\/930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/comments?post=930"}],"version-history":[{"count":0,"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/posts\/930\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.funk.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}