This site serves as a tutorial for how to get started integrating the Braze Web SDK.
The framework of this site (HTML, CSS, Javascript) is already build out such that all that needs to be added is the Braze SDK and relevant methods to start logging user data. You don't need to know much about HTML or Javascript to get going here.
This was ideated and created by Seth Tillis @sdtilliss as part of his 2019 Summer Internship
- Clone or download the repo to your computer.
- There are two files that require editing:
index.htmlandscript.jsThey can be edited in any text editor or IDE. Check out Sublime or atom if you don't have a text editor already
-
Once cloned/downloaded open up
index.htmland integrate the Braze SDK by following the instructions on our [github] (https://github.com/Appboy/appboy-web-sdk#getting-started). Be sure to change the base URL initialization options to target our staging environment sondheim.braze.com. -
Now that you have the SDK loaded, click on the
index.htmlfile to open it in your browser. Open your developer console (CMD + Option + J on Chrome/Mac) and type inappboyyou should see a response that looks like the below which means you've successfully implemented. If you don't see that response, check step 1 again.
{AF: ƒ, initialize: ƒ, destroy: ƒ, getDeviceId: ƒ, toggleAppboyLogging: ƒ, …}
- Next, you'll want to go through the
script.jsfile to add the Braze SDK methods to the javascript to actually collect user data in Braze when you click on the buttons. Throughout thescript.jsfile, you'll find comments that tell you what to do. Example:
//TODO ADD CODE HERE. Pass the email variable into the Braze email capture method.
You'll need to use your resources to identify which Braze method needs to be called here and insert it appropriately.
- Once you've gone through and updated the
script.jsfile, openindex.htmlback up in your browser and start sending data by entering info in the text fields and clicking the submit buttons. You can look in the Braze dashboard to find your user in your target environment and validate that the data is set appropriately