Pardot

A quick guide to integrate Legal Monster with Pardot forms, this guide is a bit technical. If you need any help don't hesitate, just contact us.

Create the form

First create the form with the fields you wish to have, then preview the form and show the source code of the page. Look for a div that looks like this (the value of the id will be different):

<div id="error_for_565452_167532pi_565452_167532" style="display:none"></div>

Save the id of the div.

Insert Legal Monster tracking into form

To integrate with Pardot forms first go to the "Look and Feel" settings on the form where you wish to integrate Legal Monster. Click "Above Form" and then the "Show Source" icon.

In this code view you need to place the following Legal Monster script:

<script type="text/javascript">
!function(){var legal=window.legal=window.legal||[];if(!legal.__VERSION__)if(legal.invoked)window.console&&console.error&&console.error("Legal.js snippet included twice on page.");else{legal.invoked=!0,legal.methods=["document","signup","user","ensureConsent"],legal.factory=function(o){return function(){var e=Array.prototype.slice.call(arguments);return e.unshift(o),legal.push(e),legal}};for(var e=0;e<legal.methods.length;e++){var o=legal.methods[e];legal[o]=legal.factory(o)}legal.load=function(e,o){var t=document.createElement("script");t.type="text/javascript",t.async=!1,t.src="https://widgets.legalmonster.com/v1/legal.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n),legal.__project=e,legal.__loadOptions=o||{}},legal.SNIPPET_VERSION="1.1.0"}}();
legal.load("<<PROJECT PUBLIC KEY>>");
legal.signup("<<SAVED ID FROM DIV>>", {
insertMode: "append"
});
</script>

Replace <<PROJECT PUBLIC KEY>> with the public key of your project and <<SAVED ID FROM DIV>> with the id we copied in the first step of this guide.

Now you should get the Legal Monster signup widget just above the submit button.

Save name and email on user

To ensure that we save the name and the email of the user after they have submitted the form navigate to the "Completion Actions" settings for the form. Click "Thank You Code".

Paste the following code in:

<script type="text/javascript">
!function(){var legal=window.legal=window.legal||[];if(!legal.__VERSION__)if(legal.invoked)window.console&&console.error&&console.error("Legal.js snippet included twice on page.");else{legal.invoked=!0,legal.methods=["document","signup","user","ensureConsent"],legal.factory=function(o){return function(){var e=Array.prototype.slice.call(arguments);return e.unshift(o),legal.push(e),legal}};for(var e=0;e<legal.methods.length;e++){var o=legal.methods[e];legal[o]=legal.factory(o)}legal.load=function(e,o){var t=document.createElement("script");t.type="text/javascript",t.async=!1,t.src="https://widgets.legalmonster.com/v1/legal.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n),legal.__project=e,legal.__loadOptions=o||{}},legal.SNIPPET_VERSION="1.1.0"}}();
legal.load("<<PROJECT PUBLIC KEY>>", {
identifier: "%%email%%"
});
legal.user({
name: "%%first_name%% %%last_name%%",
email: "%%email%%"
});
</script>

Remember to replace <<PROJECT PUBLIC KEY>> with your public key.