For people who like to make things

In my last post I wrote that I followed some instructions to exclude myself from Google Analytics’ reports on my Octopress blog. There was an error in the Javascript that was preventing the required cookie from being set. Here’s what I did that finally worked:

The instructions that I found in Google’s support forum correctly show how to set a filter to exclude any requests where the client has a custom cookie set. However, the javascript code that’s supposed to generate the cookie gave me a ‘variable not defined’ error. This page had the instructions that worked for me. For completeness, here’s the current version of the HTML file I use to exclude myself from the reports:

{% include_code octopress/exclude.txt lang:html %}

Essentially, I moved the line that sets the cookie from the body tag to line 11.


© 2019 Aijaz Ansari
The Joy of Hack by Aijaz Ansari is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Powered by Pelican