Sorry for coming back to this. I have followed those cookies a bit now and I see several of those first-party cookies being sent by the browser to my sites.
What seems to happen is the following:
site1.example.com sets a cookie for .example.com (id=3, id=6 for logged-in visitors)
site2.example.com sets a cookie for .example.com (id=3, id=6 for logged-in visitors)
site3.example.com sets a cookie for .example.com (id=1, id=5 for logged-in visitors)
www.example.com/subdir, example.com/subdir sets a cookie for .example.com (id=7 for all visitors)
www.example.com, example.com sets a cookie for .example.com (id=1, id=5 for logged-in visitors)
www.anotherexample.com sets a cookie for .anotherexample.com.com (id=3, id=6 for logged-in visitors)
As shown above the ids can differ by site or by subdirectory or because the visitor is logged in or not.
site1, 2 and 3 are basically just staging servers for the production servers and normally they will not deliver any tracking code at all. But for testing purposes they sometimes do have tracking code enabled. In this case it is the same tracker id that the production site uses.
In the past I assumed that the tracking would be strictly separated by the tracker id. Is that still correct?
I see that each one sets a different cookie (name). The first four cookies have different names but all of them get sent by the browser when accessing a site under *.example.com because the root is .example.com. This is without any editing by me.
What’s not clear to me now, is whether these four cookies “count” for each of the sites/logged-in status independently (what I want) or if they count, no matter which site under .example.com is used. e.g. I do not want that a site tracking with id=1 counts for id=7 etc.
Is this what I get with the default setup or do I have to change something?
If I understand vipsoft’s explanation above correctly, then setting .setCookieDomain(’.example.com’) would assure that I can track all four sites mentioned above under one tracker id. Correct? e.g. site3.example.com and www.example.com (both using the same tracker id). What I do not understand here is the difference of using both sites with the same tracker id, one time with .setcookiedomain() and one time without .setcookiedomain(). What difference do I get in the stats? For me it seems that I just get everything collected in the tracker id. I don’t see different stats for site3 and www. for instance in the website statistics of id 1, although I haven’t used .setcookiedomain().
And what about the subdir case? Is it enough to have it on its own tracker id to get separate stats?
Cookies I see for example.com are: _pk_id.1.1.d17, _pk_id.7.1.d17, _pk_ses.1.1.d17
With www.example.com I have: the same three cookies plus _pk_id.1.1.2f8c for .www.example.com.
With site3.example.com I have: the same three cookies plus _pk_id.1.1.bac3 and _pk_id.1.5.bac3 for .www.example.com.
The 1 and 5 and 7 obviously being different tracker ids while the code at the end is for the various sub-sites.
Does this look correct?
Do I understand correctly that e.g. the cookie with the 5 doesn’t matter of the current tracker id isn’t 5, but 1?
Thanks. I hope this wasn’t too confusing and I didn’t confuse ids or sub-sites myself.
Should I change anything in my setup?