# JotForm

# Pass UTMs to embedded JotForm

#### Create hidden fields to your form

Unique Name is key, it should match with our naming convention

[![](https://docs.utmsimple.com/uploads/images/gallery/2023-05/scaled-1680-/image-1684266240871.png)](https://docs.utmsimple.com/uploads/images/gallery/2023-05/image-1684266240871.png)

#### Embed iframe in your site

Append class as `utm-src` as seen in the pic

[![](https://docs.utmsimple.com/uploads/images/gallery/2023-05/scaled-1680-/image-1684266283349.png)](https://docs.utmsimple.com/uploads/images/gallery/2023-05/image-1684266283349.png)

#### Add the following script

```
<script>
setTimeout(
	function(){
		handlj('.utm-src').each( (i,t) => {
			handl_utm = HandL.getAll()
			var merged = handlj.extend( {}, handl_utm, HandL.getSearchParams(this.href) )
			if (t.src !== undefined){
				var src = t.src.split("?")[0];
				if ( !$.isEmptyObject(merged) )
					t.src = src+"?"+$.param(merged)
			}
		})
	}, 1000
)

</script>

```

[![](https://docs.utmsimple.com/uploads/images/gallery/2023-05/scaled-1680-/image-1684266402745.png)](https://docs.utmsimple.com/uploads/images/gallery/2023-05/image-1684266402745.png)

If the above solution does not work... Try this...

```
<script>
setTimeout(() => {
	if (typeof(handlj) == 'function'){
		var iframeParams = [];
		iframeParams.push( handlj.param(handlj.extend({}, HandL.getUrlVars(), HandL.getAll())) )
		var src = ifr.src;
		ifr.src = src + "?" + iframeParams.join('&');
	}
}, "500");
</script>

```