Advanced Configurations
Last updated Sep 20th, 2024
Overview
While most of the installation and configurations for the website visits tracking are relatively straightforward, below are a few advanced configurations that may help you if you need further control.
Disabling Automatic Tracking
If you prefer manual control over tracking:
window.signals = Object.assign([], {
_opts: { autoTracking: false },
// ... rest of the initialization code
});
Manual Page View Tracking
To manually track page views:
window.signals.page();
// or with a specific URL
window.signals.page('https://example.com/specific-page');
Form Submit Listeners
For third-party form providers, use event listeners to capture submissions. Here's an example for HubSpot forms:
window.addEventListener("message", function(event) {
if (event.data.eventName === "onFormSubmitted" && window.signals) {
const values = event.data.data.submissionValues;
if (values) {
window.signals.form({
email: values.email,
name: values.firstname + ' ' + values.lastname,
});
}
}
});
Troubleshooting
If you're not seeing any data:
- Check your website's Content Security Policy (CSP) headers. Ensure the following hosts are allowed:
- connect-src 'self' https://api.cr-relay.com/
- script-src-elem 'self' 'unsafe-inline' https://cdn.cr-relay.com/
- If you're using a Consent Management Platform, make sure to configure the necessary permissions for Common Room tracking.
For further assistance, please contact our support team through the Common Room Slack channel.