With the marketing add-on, you can use our lead generation feature in combination with Salesforce Pardot forms to gate your Foleon publications.

In this article, we’ll show you how to gate content with a Salesforce Pardot form.

In this article

  • Why gate forms with a Salesforce Pardot form
  • Gating your publication with a Salesforce Pardot form
  • Assigning your gate to a page

Why gate forms with a Salesforce Pardot form

Our lead generation feature allows you to block (further) access to your publication on any page. Visitors are prompted with a pop-up and will have to fill in their personal details in order to access your publication (or the rest of it).

Depending on your license, you can either collect their personal details with a native Pardot form or with social login through Facebook or LinkedIn.

As a marketer or demand generation specialist, you want to have this information in Salesforce Pardot instantly. So you can automatically assign leads to your sales reps, do lead scoring and marketing automation right when they convert.

You won’t have to manually upload all leads in these platforms and next to that you will have correct attribution in Salesforce Pardot as well.

Tip: Don’t forget to enable SalesForce Pardot tracking on your Foleon publications

Gating your publication with a Salesforce Pardot form

In order to use a Salesforce Pardot form for lead generation, create a form in Salesforce Pardot. Create the input fields and style the form to your liking.

Next, go to Home -> Marketing -> Form > Edit form > Look and Feel

Above the form, switch to ‘source view’ by clicking on the source icon button in the text-editor.

Then add the following code:

<script type="application/javascript" async>
function sendHeight(){
var body = document.body;
var html = document.documentElement;
var contentHeight = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
if(window.foleonPreviousContentHeight !== contentHeight){
location: window.location,
context: "foleon-iframe-resize",
height: contentHeight
}), "*");
window.foleonPreviousContentHeight = contentHeight;
var targetNode = document.documentElement;
var config = { attributes: true, childList: true, subtree: true };
var documentObserver = new MutationObserver(sendHeight);
documentObserver.observe(targetNode, config);
window.addEventListener('DOMContentLoaded', (event) => {
location: window.location,
context: "foleon-iframe-DOMContentLoaded"
}), "*");

This script will make sure that the form is loaded quickly and sized correctly.

It should look something like this:

Go to step 4 ‘Completion Actions’.

Click the second tab named ‘Thank You Code’ and paste the following script in the source code.

<script type="application/javascript" async>
location: window.location,
context: "foleon-form-submitted"
}), "*");

This script will communicate to Foleon that the form has been submitted successfully. It should look something like the following image:

The last thing we need to do to gate our Foleon publication is adding the form link to Foleon.

Go to your form and open the form contents overview. Copy the link variable that is displayed in that overview. It looks something like this:


Go back to your Foleon publication. Open settings > publication settings and in the left-hand-side of your settings page you should see the section ‘Lead generation’.

Click on that link or scroll down until you reach the lead generation settings.

Turn on gate your publication and choose Salesforce Pardot as your preferred gating method.

Paste the form link into the required field, choose your layout template, and hit Save. You will now be redirected to your gated content and there you will see your Salesforce Pardot form.

Assigning your gate to a page

When you’ve finished setting up your lead generation method, connect it to any of your pages.

The lead generation form can be found in the Pages overview. Simply grab the lead generation gate and drag & drop it in front of the page on which you want the gate to appear.

Instead of gating your entire piece of content, you can give your readers access to a limited portion and make them hungry for the rest.

Once you’re satisfied with your publication and the gate you’ve created, hit Publish or Preview and witness your gated content in its full glory.

Did this answer your question?