Trigger lead flow to appear based on link/button click

Migrated from legacy feedback forum with 41 votes.

 

An example, provide a way to trigger the Leadin Popup Form to appear when a user clicks on a 'Download EBook' link in a blog post. If this is something you'd be interested in, please vote and leave a comment describing how you'd use this feature below.

HubSpot updates
36 Replies
WarrenWoermke
New Contributor

I agree, this functionality would be very helpful for us (whether it be a lead flow form or regular form, either would be a big improvement).

Having to redirect a visitor to yet another page to fill out a very simple form is not ideal, particularily for a first time visitor. 

GSantos
Occasional Contributor

+1 here

We have a main campaign running with a enquiry form on the page, but there's a download offer that we would to use on a CTA button and a popup form. So if the visitor don't fill the enquiry form, at least we can get his contacts with a download and nurture after the campaign.

RafiPN
Regular Contributor

Totally thought I could get this working with buttons using anchor links or custom queries but support said I needed a hard page refresh which isn't nice to visitors at all. Definitely should add this feature! 

rodschneider
Visitor

I agree with everyone here.  I have a button on my home page for people to sign up to receive our Email Newsletter.  I want to pop up a lead flow on button click.

siez18
New Contributor

Was this feature ever released? I am also looking for some way to do this. 

 

Currently my blog posts are appearing a bit bulky as I have embed hubspot forms in them to provide lead magnets. I want to remove those forms from the posts and use lead flows instead but having a link or button as a trigger will make everything really great. 

 

Any way to do this? 

 

Shabaz 

gamebenchjake
New Contributor

Hey all! Just a heads up, I've got this working now. You can call the following Javascript to trigger the Lead Flow:

window.leadflows.dynoFactory.create(window.leadflows.lfConfig.leadFlows[0]).open()

This will call the first lead flow that you have registered on the page. If you have more than one, just increment the in the [0] bit.

An example of a link that will do this:

<a href="javascript&colon;void(0);window.leadflows.dynoFactory.create(window.leadflows.lfConfig.leadFlows[0]).open()">Click me!</a>

(replace the &colon; above with an actual colon; the formatter here is messing it up)

Reply back if you need any help and I'll see what I can do Smiley Happy

Community Thought Leader

Thanks @gamebenchjake, code works fine in Shopify stores rendered in Chrome and Edge, but not Firefox.

<a href="javascript&colon;void(0);window.leadflows.dynoFactory.create(window.leadflows.lfConfig.leadFlows[0]).open()">HubSpot Pop-Up</a>

 

gamebenchjake
New Contributor

Hey @MFrankJohnson ,

Interesting, do you have a link to your page that I could look at in Firefox? I'm sure it's probably to do with the way the href attribute is being handled.

EDIT: If you keep the "javascript&colon; void(0);" in the href attribute, you can move the rest of the snippet to an

onclick=""

attribute and it should work Smiley Happy

J

gamebenchjake
New Contributor

Just to update everyone (as I don't believe editing triggers an update), for Firefox support, the link should be:

<a href="javascript&colon; void(0);" onclick="window.leadflows.dynoFactory.create(window.leadflows.lfConfig.leadFlows[0]).open()">Hubspot Lead Flow Link</a>

I'll be putting together a small JS file which extends the leadflow script to make this cleaner., and most likely add in any other small extensions for stuff like this if anyone has any other requests.

Community Thought Leader

>>"I don't believe editing triggers an update"

Correct. (these ideas threads aren't like regular discussion threads)

Works perfectly. Confirmed on Chrome, Edge, Firefox (Windows 10).

Thanks again.