How to install the Web SDK: a step-by-step guide
Short answer: The Web SDK is a small client library. Add one script, configure the property key and endpoint, and send events only after the visitor has given consent.
1. Create a web property
In the dashboard, create a property for your domain and copy its public key. The public key is safe to place in front-end code.
2. Add the script and configuration
Load the SDK and set the property key, the region and the allowed endpoint hosts. The SDK refuses to send to any host that is not on the list.
3. Ask for consent
Call the consent method when the visitor agrees. Until then, the SDK creates no identifiers and sends no events. If the visitor sends a Global Privacy Control signal, persistence is disabled.
4. Check the first events
Open a page, then check the Events screen. A page view should appear within a few seconds.