Does the sp cookie store the network user ID?

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

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!

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?

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 ?

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.

@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.

Ah, of course! Good point.

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.

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.

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

1 Like

I know this is a old thread but with ITP2.1 and updates to SNI in SSL cert it worth updating this thread…

(A suggested…)
Solution for ITP2.1 and Analytics (for many use cases not all)

Create certificate with AWS certificate manager (can be across multiple domains and wildcard subdomains if needed)
Create and Clojure collector
DONT configure domains
Configure cookie lifetime

IF Ga user you can also save sp cookie in a dimensions as well as client ID

Downside is that you cant track users across subdomains and domains but you can track a profile for longer then 7 days in both GA and Snowplow …

Would be interested to hear what other people have done around this topic or if anyone see more issues with this approach

Noticed this post to

by @Simon_Rumble to cover this.