Apr 9, 2025
If you don't have a CDP and don't want to use a database, this approach will allow you to pass accurate campaign data to your CRM.
If you're a marketer focused on lead generation, you're adding parameters to links in campaigns to track campaign performance. If a user clicks one of your links and then completes a form on your site, those campaign parameters need to be passed through to your CRM.
Because my audience is marketers I've written this as simply as possible. Even if you have a primitive understanding of JavaScript, I think you'll be able to follow along.
Below is an example of a URL that might be created to track a specific campaign. This URL contains the standard UTM parameters but you can also use custom parameters.
Below is an example of a URL with custom parameters.
Using vanilla Javascript, we're going to make use of the URLSearchParams utility. This is a JavaScript constructor that provides a lot of helpful methods for manipulating data
// get query string from url
const paramsString = window.location.search;
// create a new URLSearchParams object
const params = new URLSearchParams(paramsString);
Demand Stack, All Rights Reserved 2025