Skip to content

Instantly share code, notes, and snippets.

View simone-coelho's full-sized avatar

Simone Coelho simone-coelho

View GitHub Profile

Client Slideout Modal Template - Documentation

📋 Overview

This template creates a customizable slideout modal that appears from the left or right side of the page. It features dynamic content, styling options, dual buttons, and comprehensive tracking capabilities.

✨ Simplified Design: This template has been streamlined with a single background color option for ease of use, removing complex split-color functionality that wasn't specified in the original requirements.

🎯 Features

@simone-coelho
simone-coelho / client-slideout-template-documentation.md
Last active June 13, 2025 17:02
DirectTV Client Slideout Modal Template - Optimizely Extension with Documentation

Client Slideout Modal Template - Documentation

📋 Overview

This template creates a customizable slideout modal that appears from the left or right side of the page. It features dynamic content, styling options, dual buttons, and comprehensive tracking capabilities.

✨ Simplified Design: This template has been streamlined with a single background color option for ease of use, removing complex split-color functionality that wasn't specified in the original requirements.

🎯 Features

import UIKit
// Import the Optimizely iOS SDK for Feature Experimentation
// import Optimizely
class CarouselViewController: UIViewController {
// MARK: - Properties
// Replace this with the real OptimizelyClient initialization
let optimizelyClient = OptimizelyClient(sdkKey: "YOUR_SDK_KEY")
import UIKit
// Import the Optimizely iOS SDK for Feature Experimentation
// import Optimizely
class CarouselViewController: UIViewController {
// MARK: - Properties
// Replace this with the real OptimizelyClient initialization
let optimizelyClient = OptimizelyClient(sdkKey: "YOUR_SDK_KEY")
const axios = require('axios');
/**
* Maps mParticle event data to Optimizely's Full Stack event format
* @param {MParticleEvent} mpEvent - The mParticle event object
* @param {Array} eventMap - List of events with their corresponding IDs
* @returns {OptimizelyEvent} Formatted Optimizely event payload
*/
function createOptimizelyPayload(mpEvent, eventMap) {
if (!mpEvent?.data?.custom_event_type) {
@simone-coelho
simone-coelho / bucketing_script.js
Last active September 17, 2021 18:49 — forked from thegreekjester/bucketing_script.js
Bucketing script given input CSV
/*
Install required libraries:
- yargs (CLI)
- fast-csv (csv parser and writer)
- @optimizely/optimizely-sdk (optimizely SDK)
The following script takes in the following CLI arguments:
sdkKey (str): SDK Key of Optimizely datafile you wish to use
csv_file_path (str): The input CSV relative path with the following columns --> "User Identifier", "Bucketing ID",
@simone-coelho
simone-coelho / experiment.ts
Created April 19, 2021 23:39 — forked from athal7/experiment.ts
2u lambda edge implementation
import optimizely from '@optimizely/optimizely-sdk'
import optimizelyLogging from '@optimizely/optimizely-sdk/lib/plugins/logger'
import optimizelyEnums from '@optimizely/optimizely-sdk/lib/utils/enums'
import cookie from 'cookie'
import rp from 'request-promise'
import uuidv4 from 'uuid/v4'
import {
Callback,
Handler,
CloudFrontRequest,
let axios = require("axios");
let argv = require("yargs").argv;
let s3 = require("@auth0/s3");
let fs = require("fs");
let path = require("path");
// let parquet = require('node-parquet');
let appDir = path.dirname(require.main.filename);
let decisionsFiles = [];
let eventsFiles = [];
//require('s3-upload-resume');
// BEGIN: Initialize Optimizely Event Push
function dispatchOptimizelyEvent(payload, eventID, eventKey) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) { // request finished and response is ready
if(xmlhttp.status == 204) {
console.log('Fired event to Optimizely: ', eventKey);
} else {
console.log('Failed to dispatch Optimizely event: ', xmlhttp.responseText);
}
@simone-coelho
simone-coelho / project.js
Last active August 20, 2020 19:57 — forked from davidsertillange-optimizely/project.js
Mirroring Web events in Full Stack
/*
How to use:
Step 1: line 20-26, enter account_id, project_id, Full Stack user_id, environmentKey, and updateDatafile
Step 2: make sure your Full Stack project has the events you want to mirror created.
The API names need to match between the Web and Full Stack events.
Example: on Web, i have a click event "Homepage clicks" with API name "123456790_homepage_clicks"
In the Full Stack project, a custom event with the same name "123456790_homepage_clicks" needs to be created for this script to work
Step 3: add the script to Project Javascript
Step 4: load your page and check the network tab for events going to /events with "client_name": "Optimizely/fswebintegration"