Integrating Contextual into a BigCommerce site¶
Requirements¶
This setup assumes that you have already setup your App Key on the Dashboard.
Integration Steps¶
Step 1¶
To integrate Contextual WebSDK on BigCommerce Website. First, Log into the BigCommerce account and then click on Storefront from the left-hand side. Now click on Script Manager to add Cutom Javascript code.
Step 2¶
Now click on Create a Script to open a screen with form fields to create the script as shown in the image below.
Step 3¶
Enter the Name of your script on the Name of Script section and the provide some description on the Description field.
Select Footer on the Location on page to add the scripts on the footer section. and then select All pages in the section Select pages where script will be added.
Now choose Essential from Script category and select the script on the Script type. Finally, insert your code in the script contents field.
Then click on save.
Now the Installed Scripts on BigCommerce look like this.
To get the Contextual Javascript snippet and initialisation code, please login to Contextual and go here
Once you are on the settings page select the web section then copy the script and initialisation code into the Script contents, as shown in the image below.
Step 4¶
Check that you have either set user_id or removed it from the initialisation script.
Note
user_id is the name you want to give to your users. This name is up to you. For more info visit the Tagging documentation. When you call register method, USER_ID is optional, you can set it later by sending user_id tag, it is string tag.
Step 5¶
Save the changes that you have made to your site and then go to your BigCommerce site and reload the page.
Video of the Integration steps¶
Troubleshooting¶
If you have any issues integrating Contextual into your BigCommerce site please visit the troubleshooting guide here