0 Likes

Browser Extension for Test Cookie

Status: New
by Level 13 ‎11-19-2015 November 19, 2015

Something I thought of when I got off a call with someone from the team on Optimizely. Obviously, one can set it up following Optimizely's documentation, but it'd be really great for higher ups in my company to simply download a browser extension to set a test cookie.

Level 13

Comments
by JDahlinANF
‎11-20-2015 November 20, 2015

Try this one: http://conversion.com/blog/introducing-conversion-coms-optimizely-chrome-extension/

 

In my experience, using a browser extension does not make it easier for non-technical executives... I usually go the route of setting up code that sets the test cookie if a certain URL param is detected.  That way all they need to do is click a link.

Level 2
by Level 13
‎11-20-2015 November 20, 2015

Nice, good link and that's a good approach, might give that a go.

Level 13
by jpfotoz
‎11-24-2015 November 24, 2015 - edited ‎11-24-2015 November 24, 2015

Very nice extension.. just installed it.

 

I've also used this: -- just create a bookmaklet. Then click on it to add the cookie - easy as pie! (Pun intended!)

 

javascript:(function(){ var hostname = window.location.hostname; var parts = hostname.split("."); var publicSuffix = hostname; var last = parts[parts.length - 1]; var expireDate = new Date(); expireDate.setDate(expireDate.getDate() + 7); var TOP_LEVEL_DOMAINS = ["com", "local", "net", "org", "xxx", "edu", "es", "gov", "biz", "info", "fr", "gr", "nl", "ca", "de", "kr", "it", "me", "ly", "tv", "mx", "cn", "jp", "il", "in", "iq"]; var SPECIAL_DOMAINS = ["jp", "uk", "au"]; if(parts.length > 2 && SPECIAL_DOMAINS.indexOf(last) != -1){ publicSuffix = parts[parts.length - 3] + "."+ parts[parts.length - 2] + "."+ last} else if(parts.length > 1 && TOP_LEVEL_DOMAINS.indexOf(last) != -1) {publicSuffix = parts[parts.length - 2] + "."+ last} document.cookie = "optly_"+publicSuffix.split(".")[0]+"_test=true; domain=."+publicSuffix+"; path=/; expires="+expireDate.toGMTString()+";"; })();

 (Code for those who don't know about the cookie script.) 

Level 6