This file contains hidden or 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
/* | |
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", |
This file contains hidden or 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 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, |
This file contains hidden or 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
/* | |
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" |