I have created in Google Analytics custom segment
Custom Variable (Key 1) contains AbTestDesign
This is the screenshot:
My current analytics script is:
!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-10969791-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxxxx-1');
</script>
How should I change my script so that this custom variable (key 1) is set to 'AbTestDesign' using Javascript on the session level?
The documentation is so confusing (as the analytics changes much faster than original documentation I guess): https://developers.google.com/analytics/devguides/collection/gtagjs/custom-dims-mets