/
Custom event from URL parameter
Custom event from URL parameter
Send2CRM custom events are a good way to pass information from the website to the CRM when no form submission is involved. Below is a basic example of how to generate an event based on the presence of a URL parameter.
// Do not act until the document is loaded.
window.addEventListener('load', (evt) => {
// Get the custom parameter from the URL.
let urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('myparam')) {
// Record a custom session event.
send2crm.analytics?.setCustomEvent('MYEVENT', {
myparam: urlParams.get('myparam')
});
}
});
, multiple selections available,
Related content
Visitor identification
Visitor identification
Read with this
Session Events
Session Events
More like this
Record a Search event
Record a Search event
More like this
Email click-through
Email click-through
More like this
UTM parameters
UTM parameters
More like this
Custom landing page
Custom landing page
More like this