# Track UTMs in Samcart Checkout Page

#### Adding Custom Fields in SamCart

First, let's add custom fields to SamCart as shown below:

[![](https://docs.utmsimple.com/uploads/images/gallery/2024-04/scaled-1680-/image-1713322573628.png)](https://docs.utmsimple.com/uploads/images/gallery/2024-04/image-1713322573628.png)

The picture only shows `utm_source`, but you can add as many parameters as you'd like to track. Check here for a list of the parameters you can track with our solution: [What can I track with UTMSimple?](https://docs.utmsimple.com/books/101-lets-start/page/what-can-i-track-with-utmsimple)

#### Adding Hidden Fields to Your Checkout Page

Edit your checkout page (Design) and add all the custom fields you've added in Step 1, as shown in the image below.

[![](https://docs.utmsimple.com/uploads/images/gallery/2024-04/scaled-1680-/image-1713322699643.png)](https://docs.utmsimple.com/uploads/images/gallery/2024-04/image-1713322699643.png)

#### Insert UTMSimple Code into the Checkout Page

Go to `Products > Advanced Settings` and copy-paste the following code into `PIXELS > Embed HTML/Scripts in Footer` section. Make sure to update your license key accordingly. This code will hide all the custom fields and prefill them accordingly with the data coming from the client's COOKIES.
```
<!-- Global site UTM Simple Tracking Start-->
<script>
handl_custom_params=[];var handl_js=document.createElement("script");handl_js.setAttribute("src","https://track.utmsimple.com/utm.js?license=YOURLICENSEKEY"),document.head.appendChild(handl_js),
handl_js.onload=function(){
	var data = HandL.getAll()
	setTimeout(
		function() {
			jQuery("[id*='custom']").map((i, v) => {

				let key = $(v).next().html()
				let c_val = data[key]

				if (c_val) {
					$(v).val(c_val)
				}
			})
		}, 1000
	);
	
	handlj( document ).ready(function() {
		handlj("[id*='custom']").map((i, v) => {
			handlj(v).parent().parent().parent().hide()
		})
	})
};
</script>
<!-- Global site UTM Simple Tracking End-->
```