views:

94

answers:

2

Hello,

I have a Rails app where I set a set a session variable the moment a user lands on my site with the referer and the page they hit. Additionally, I have Google Optimizer sending traffic from my homepage to various landing pages. The problem is that I think Google Optimizer is sending users away before the cookie is set.

Is that even possible? I believe that the cookie is set from the HTTP Header, which must have fully loaded before Google's Javascript has even loaded.

Thanks, Jason

A: 

You're absolutely correct - the explanation you propose isn't possible. Assuming the browser is loading the page from your site that sends the cookie header, it will be set, and JavaScript can't directly interfere with this.

So the problem is elsewhere - the first thing I would test is whether the Cookie header is actually being sent, whether it's being set (look in your browser's security/privacy panel), and then whether your code for checking if it's been set is functioning correctly.

grahamparks
A: 

As you suspected, the cookie should be sent in the header when the visitor hits your page, so google optimizer shouldnt be affecting this..

You may want to double check that you are setting the cookie, you can use firebug or similar for this (in the Net tab).

Matt