Install Beacon Tracker
Add Beacon Events
Test and Verify Beacons
Follow the below steps to install the GroupBy tracker to your website:
- Add tracker script
- Instantiate the GbTracker
- Verify tracker installation
|Apps that use a bundler like Webpack can import the tracker from NPM.
|CustomerID||String||Yes||Your GroupBy Customer ID.|
|Area||String||Yes||GroupBy area such as Production, Staging, Demo, and so on.|
autoSetVisitor to configure the Visitor ID and Session ID cookies before using the tracker instance.
If the values for the Visitor ID and Session ID cookies are already set, the tracker instance uses them while sending the beacon. The cookies reset to the existing values but with new expiry dates.
If values for the cookies do not exist, new values are generated and set with expiry dates. When set, the Visitor ID cookie expires in 10 years and the Session ID cookie expires after 30 minutes of shopper inactivity.
autoSetVisitor has an optional parameter for the LoginID.
|LoginID||String||No||Hashed client information as stored in your database.|
Including the shopper’s username helps GroupBy track the shopper’s journey across devices. Hash this value before setting it in the tracker to comply with data privacy laws.
To verify that the tracker is successfully installed, navigate to your browser’s developer tools.
Chrome: Press CTRL + SHIFT + J while viewing the page to debug
Firefox: Press CTRL + SHIFT + K while viewing the page to debug
Microsoft Edge: Press F12 while viewing the page to debug
Look for the GbTracker constructor in the developer console. To quickly locate the constructor, start typing gbtracker in the console prompt.
If you see nothing helping you autocomplete the tracker’s constructor name, it wasn’t installed correctly.
If you see the name gbtracker autocompleted for you, it was installed correctly.