Storing UTM Parameters in Cookies

BankingBridge can tag common UTM parameters with the lead submission. Those parameters include utm_campaign, utm_medium, and utm_source.

What are the benefits of UTM parameters?

Storing UTM parameters in your website cookies can be beneficial for several reasons, including:

  • It allows you to track website visitors' UTM parameters beyond the first page they land on. This is because cookies are stored on the user's device and will be sent with each subsequent request to your website. This means you can track how users interact with your website, even if they click through to different pages or leave your website and come back later.
  • It can help you to improve your website's conversion rate. By tracking which UTM parameters are associated with conversions, you can see which marketing campaigns are most effective at driving traffic to your website and generating leads or sales. This information can then be used to optimize your marketing campaigns and improve your website's conversion rate.
  • It can help you to understand your website visitors' behavior. By tracking which UTM parameters are associated with different pages on your website, you can better understand how your visitors interact with your website. This information can then be used to improve your website's navigation, content, and design.

How to store UTM parameters on your website

  1. Create a cookie. The first step is creating a cookie to store the UTM parameters. The cookie should have a name that is unique to your website, and it should contain the following information:
    1. The UTM parameters
    2. The expiration date of the cookie
    3. The domain of your website
  2. Set the cookie. Once you have created the cookie, you need to set it. This can be done using JavaScript or PHP. The following example shows how to set a cookie using JavaScript.
var cookie = document.cookie;  
cookie += "; utm_source=google; utm_medium=cpc; utm_campaign=summer_sale";  
document.cookie = cookie;
  1. Read the cookie. Once you have set the cookie, you can read it to get the UTM parameters. This can be done using JavaScript or PHP. The following code shows how to read a cookie using JavaScript:
var cookie = document.cookie;  
var utm_source = cookie.split(";")[0].split("=")[1];  
var utm_medium = cookie.split(";")[1].split("=")[1];  
var utm_campaign = cookie.split(";")[2].split("=")[1];
  1. Use the UTM parameters. Once you have read the UTM parameters, you can use them to track your website visitors' behavior. For example, you could use the UTM parameters to track which marketing campaigns are most effective at driving traffic to your website and generating leads.