This project requires Node.js to be installed on your machine. If you don't have it installed, you can download it here. Another option is to use a package manager like Homebrew to install Node.js. If you have Homebrew installed, you can run the following command:
$ brew install node
npm i
There are a few existing options to be able to serve this site on your local machine (HTTP-Server or Node.js Server):
Use HTTP-Server : http-server package to serve the files locally. You can install it globally by running the following command:
$ npm i
Then you can start the server by running the following command:
$ http-server
Open your browser and visit http://localhost:8080. These files will now be served over HTTP, which will bypass the CORS restrictions.
Run this command to start the Node.js server :
$ node server.js
Open your browser and visit http://localhost:3001/.
- Update the
.env.primary
file with these variables and their values from your Segment workspace. Update the links with the links to your Segment Resources.
GTAGID=""
# LINK TO AJS SOURCE : https://app.segment.com/
SEGMENTAJSWRITEKEY=""
# LINK TO SERVER SOURCE : https://app.segment.com/
SEGMENTNODEWRITEKEY=""
# LINK TO UNIFY SPACE : "Segment Demo Space"
SPACEID=""
# UNIFY SPACE'S PROFILE API KEY
PROFILEAPIKEY=""
# UNIFY SPACE'S PROFILE API KEY base64 encoded value
BASE64PROFILEAPIKEY = ""
- Update the
index.html
file's<head>
with your AJS source's writeKey in 2 places within the Segment Snippet.
- The Config page (
config.html
) will locally store the provided values from the form to be used throughout the app. - Code blocks will be added the User Page to allow pasting, manual modification, and translating of event payloads between different languages (analytics.js, Node.js, Python, Ruby, JSON) which can be sent to the currently configured sources.
- Ecommerce page needs to be updated with more accurate e-commerce data that also includes images.