Skip to content

Instantly share code, notes, and snippets.

View optimizely-christine's full-sized avatar

optimizely-christine

View GitHub Profile
function sendOptimizelyEvent(eventId, key) {
try {
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
{
"plugin_id": "typed_js",
"plugin_type": "widget",
"name": "Typed Messages",
"edit_page_url": "https://www.optimizely.com/products/experimentation/",
"form_schema": [
{
"default_value": "#ffffff",
"field_type": "color",
"name": "bg_color",
{
"account_id": "1234",
"visitors": [
{
"session_id": "session1234",
"visitor_id": "somevisitor",
"attributes": [
{ "type": "custom",
"key": "attr_key",
"value": "attr_value"
@optimizely-christine
optimizely-christine / optimizely_liveramp_url_redirect_project_js.js
Last active January 27, 2017 19:23
Vets First // LiveRamp Project JS Script
//redirect URL mapping - replace this with the mapping from LiveRamp
var redirectUrls = {
"56252426" : "http://sfveterinaryhousecalls.vetsfirstchoice.com",
"12345444" : "http://bluecrosspet.vetsfirstchoice.com",
};
//Optimizely Redirect Handler
function dataHandler( LiveRampData ) {
if(LiveRampData.length > -1){
LiveRampData.forEach(function(id) {
{
"timerange": {
"begin": "2016-04-15T10:00:00-10:00",
"end": "2016-05-20T10:00:00-10:00"
},
"experiments": [
{
"variations": [
{
"archived": true,
{
"timerange": {
"begin": "2016-04-15T10:00:00-10:00",
"end": "2016-05-20T10:00:00-10:00"
},
"experiments": [
{
"variations": [
{
"archived": true,
{
"timerange": {
"begin": "2016-04-15T10:00:00-10:00",
"end": "2016-05-20T10:00:00-10:00"
},
"experiments": [
{
"variations": [
{
"archived": true,
{
"timerange": {
"begin": "2016-04-15T10:00:00-10:00",
"end": "2016-05-20T10:00:00-10:00"
},
"experiments": [
{
"variations": [
{
"archived": true,
{
"timerange": {
"begin": "2016-04-15T10:00:00-10:00",
"end": "2016-05-20T10:00:00-10:00"
},
"experiments": [
{
"variations": [
{
"archived": true,
{
"timerange": {
"begin": "2016-04-15T10:00:00-10:00",
"end": "2016-05-20T10:00:00-10:00"
},
"experiments": [
{
"variations": [
{
"archived": true,