Skip to content

Instantly share code, notes, and snippets.

View simone-coelho's full-sized avatar

Simone Coelho simone-coelho

View GitHub Profile
@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,
@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"