Some days ago I introduced the new gtag version of Google Analytics to my private website. Now I try to figure how to filter out my own traffic. Exclusion based on IP is not possible because I enter my website with different browsers from different places. So I wanted to exclude my traffic via cookie. I'm just not able to make it work. The documentation is telling I should work now with dimensions. I tried it but it is not working for me.
I set up a dimension "usertype"
and I added a filter to exclude pattern "internal" for dimension "usertype"
I created a new page for my website and put the following code
<html>
<head>
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXX-XX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};
gtag('js', new Date());
gtag('config', 'UA-XXXXXXX-XX', {'custom_map': {'dimension1': 'usertype'}});
gtag('event', 'kill_ga', {'usertype': 'internal'});
</script>
<!-- Google Analytics -->
<meta http-equiv="refresh" content="5; url=/" />
</head>
<body>
We'll transfer you soon
</body>
</html>
As I said before. I'd like to somehow mark my own traffic as internal and exclude it via filter. Could someone help me to achieve this please?