# Pardot Integration

### 1) Create the following custom fields in Pardot and add them to your form.

```
utm_campaign – Collects utm_campaign variable.
utm_source – Collects utm_source variable.
utm_term – Collects utm_term variable.
utm_medium – Collects utm_medium variable.
utm_content – Collects utm_content variable.
gclid – Collects gclid variable.
fbclid – Collects gclid variable.
```

This is the bare minimum, you can add much more fields. Please see [Native WP Shortcodes](https://docs.utmgrabber.com/books/102-getting-started-for-handl-utm-grabber-v3/page/native-wp-shortcodes) for the full list of parameters supported. 

### 2) Go to Pardot Form and add the following snippet in "Below Form" section

Remember to change this code baed on your need. e.g. swap <license_key> with your own key and add/remove fields. 

```
<!-- Global site UTM Simple Tracking Start-->
<script>
var handl_custom_params=['wj_name','wj_email','wj_phone']
var handl_js = document.createElement("script");
handl_js.setAttribute("src", "https://track.utmsimple.com/utm.js?license=<license_key>"), document.head.appendChild(handl_js), 
handl_js.onload = function() {
	
}; 
</script> 
<!--Global site UTM Simple Tracking End -->

<script type="text/javascript">
        // Parse the URL
        function getParameterByName(name) {
            return HandL.getAll()[name] 
        }
        // Give the URL parameters variable names
        var source = getParameterByName('utm_source');
        var medium = getParameterByName('utm_medium');
        var campaign = getParameterByName('utm_campaign');
        var term = getParameterByName('utm_term');
        var content = getParameterByName('utm_content');
        var gclid = getParameterByName('gclid');
        var fbclid = getParameterByName('fbclid');
         
        // Put the variable names into the hidden fields in the form. selector should be "p.YOURFIELDNAME input"
        document.querySelector("p.utm_source input").value = source;
        document.querySelector("p.utm_medium input").value = medium;
        document.querySelector("p.utm_campaign input").value = campaign;
        document.querySelector("p.utm_term input").value = term;
        document.querySelector("p.utm_content input").value = content;
        document.querySelector("p.gclid input").value = gclid;
        document.querySelector("p.fbclid input").value = fbclid;
</script>
```