This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.optimizelyEdge = window.optimizelyEdge || []; | |
window.optimizelyEdge.push({ | |
type: 'addListener', | |
filter: { | |
type: 'lifecycle', | |
name: 'campaignDecided' | |
}, | |
handler: (event) => { | |
var campaignId = event.data.decision.campaignId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
# Get AWS credentials from your Optimizely Interface https://docs.developers.optimizely.com/web/docs/customer-profiles#bulk-upload | |
client = boto3.client( | |
's3', | |
aws_access_key_id = '', | |
aws_secret_access_key = '' | |
) | |
# https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const onDecision = ({ type, userId, attributes, decisionInfo }) => { | |
// Check if a decision event was dispatched | |
if (decisionInfo['decisionEventDispatched']) { | |
// Get experiment bucketing info | |
const experimentKey = decisionInfo['ruleKey'] | |
const variationKey = decisionInfo['variationKey'] | |
const decisionString = '('+experimentKey+'):('+variationKey+')'; | |
// Sends decision info through eVar2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const onDecision = ({ type, userId, attributes, decisionInfo }) => { | |
// Check if a decision event was dispatched | |
if (decisionInfo['decisionEventDispatched']) { | |
// Get experiment bucketing info | |
const experimentKey = decisionInfo['ruleKey'] | |
const variationKey = decisionInfo['variationKey'] | |
// Optionally send a track event to Optimizely to record integration success. Make sure to have an Optimizely client or withOptimizely client instantiated | |
optimizely.track('segment_success'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from "react"; | |
var optlyPages = window.optimizelyEdge.get("state").getActivePages(); | |
// Implement the following method | |
function activateOptlyPage(optlyPage) { | |
var _apiName = optlyPage.apiName; | |
//Force deactivation of the page | |
window.optimizelyEdge.push({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"plugin_type": "analytics_integration", | |
"name": "Custom GA Integration Using Custom Dimensions", | |
"form_schema": [ | |
{ | |
"default_value": "", | |
"field_type": "text", | |
"name": "customTracker", | |
"label": "Custom Tracker", | |
"options": null |