Does the sp cookie store the network user ID?


#1

Hi

We have been running SP successfully for past few months. We have been trying to show customized pages to repeat visitors based on the domain userid in the cookie, and our knowledge about the past interests of the visitor.

I now wish to identify an anonymous visitor by reading the network user id instead of the domain userid - is that not available in the cookie? How do I do that?

Will appreciate a little help


#2

Hi @sujitb - the network_userid aka nuid is stored in a cookie against the collector’s domain; you’ll only be able to read that client-side on the same domain.

Here’s an example that will work:

Hope this helps!


#3

Alex,

Not sure if I understand this fully. In the default implementation of the clojure collector, what would be the collector domain then?

Would it be http://snowplowcc-env.ap-xxxxxxxxx-1.elasticbeanstalk.com/ which is collecting the events?


#4

Can you have multiple domain cnames for the collector ?
eg
collector.domain.com
collector.another.com
collector.third.com

Does anything need to configured on the collector to accept the multiple domains ?


#5

It would be whatever domain you are referencing in your tracker configuration.

Yes that should work, each of the domains would end up with their own nuid cookies of course.


#6

@cbragg: one thing to stress is that because the collector uses an AWS Elastic Load Balancer, you can only attach a single SSL certificate to it. (This is an limitation with Amazon’s Elastic Load Balancers.) That means that if you did run multiple CNAMEs to a single collector, only one of those CNAMES would work on HTTPS.


#7

Ah, of course! Good point.


#8

I think I have misunderstood the cookie setting component - the collector simply collects information transmitted back from the web application (it does not set cookies).
The key here is setting the cookie as @alex stated above, to allow subdomains to collect the domain_userid and other snowplow cookie set variables.

window.snowplow('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', {
  appId: 'CFe23a',
  platform: 'web',
  ...
  cookieDomain: '.yourdomain.com'
});

This then allows tracker.yourdomain.com to access the snowplow specific cookies, specifically the domain_userid.


#9

That part is incorrect @cbragg - the Clojure and Scala Stream Collectors do set a cookie - the cookie that tracks the network_userid aka nuid.

Everything else you said regarding the tracker’s cookie is correct.


#10

Thanks Alex and cbragg

Chrome in icognito mode shows all the third party cookies dropped by the site. I could see the ‘sp’ cookie being dropped by the collector domain, and that the cookie contained the nuid.

I am now going to create a subdomain of my site and map it to default url provided by beanstalk. I guess then I will be able to read the Nuid