I set a cookie:
<script>
document.cookie="cid1={{utm_campaign}}; path=/;"
</script>
The {{}} is a macro and is Google-Tag-Manager syntax, please ignore that.
The script above is triggered whenever anyone lands on example.com with a tag like so: example.com/?utm_medium=test&utm_source=bla&utm_campaign=foo. I tested it and sure enough, when I land on the home page with these parameters the cookie is set.
But a visitor can move to a subdomain dogs.example.com. When I looked in the console the cookie cid1 is no longer there.
Is there a setting I can change when creating the cookie other than setting the path to "/" so that the cookie crosses to the subdomain?