Skip to content

Instantly share code, notes, and snippets.

View robisatthefunction's full-sized avatar

Robert Saunders robisatthefunction

  • Optimizely
View GitHub Profile
{
"plugin_type": "widget",
"name": "Shopify Shopping Cart Summary",
"edit_page_url": "https://mrbeast.store/",
"form_schema": [
{
"default_value": "Your selections",
"name": "heading",
"field_type": "text",
"options": null,
"events": [
{
"entityId": "18165912951",
"key": "example_event",
"timestamp": 1690483714939,
"uuid": "hagan-test1",
"tags": {
"revenue": 123,
"value": 1,
"quantity": 1,
// Client-side JavaScript example
// Notification Listeners execute whenever a bucketing decision is made on a visitor for an A/B Test or Targeted Delivery.
// https://docs.developers.optimizely.com/feature-experimentation/docs/set-up-notification-listener-javascript
const onDecision = ({ type, userId, attributes, decisionInfo }) => {
// Check if a decision event was dispatched. This will only happen if the visitor is put into an A/B Test.
if (decisionInfo['decisionEventDispatched']) {
// Get experiment bucketing info
let experimentKey = decisionInfo['ruleKey']
let variationKey = decisionInfo['variationKey']
// Client-side JavaScript example
// Notification Listeners execute whenever a bucketing decision is made on a visitor for an A/B Test or Targeted Delivery.
// https://docs.developers.optimizely.com/feature-experimentation/docs/set-up-notification-listener-javascript
const onDecision = ({ type, userId, attributes, decisionInfo }) => {
// Check if a decision event was dispatched. This will only happen if the visitor is put into an A/B Test.
if (decisionInfo['decisionEventDispatched']) {
// Get experiment bucketing info
let experimentKey = "[Optimizely] " + decisionInfo['ruleKey']
let variationKey = decisionInfo['variationKey']
{
"plugin_type": "widget",
"name": "Extension Template",
"edit_page_url": "https://www.optimizely.com/",
"form_schema": [
{
"default_value": "afterend",
"field_type": "dropdown",
"name": "position",
"label": "Position",
{
"plugin_type": "widget",
"name": "Marketo Form",
"edit_page_url": "optimizely.com",
"form_schema": [
{
"name": "selector",
"field_type": "selector",
"options": null,
"label": "Selector",
// If put in an Optimizely Web Project JS, this will stop the snippet from executing
window['optimizely'] = window['optimizely'] || [];
window["optimizely"].push({
"type": "disable"
});
{
"account_id": "123455678",
"visitors": [
{
"visitor_id": "oeu1612384594527r0.49927100392910617",
"attributes": [],
"snapshots": [
{
"decisions": [],
"events": [
{
"plugin_type": "widget",
"name": "Text Change: Hydration Compatible",
"edit_page_url": "atticandbutton.us",
"form_schema": [
{
"default_value": ".hero__title",
"name": "selector",
"field_type": "selector",
"options": null,
// Learn more about destination functions API at
// https://segment.com/docs/connections/destinations/destination-functions
/**
* Handle track event
* @param {SegmentTrackEvent} event
* @param {FunctionSettings} settings
*/
// Learn more about destination functions API at
// https://segment.com/docs/connections/destinations/destination-functions