
LemonStand
Would you like to improve your affiliate software even more? Check out the LemonStand integration for Post Affiliate Pro.
Integrate HubSpot custom forms with Post Affiliate Pro to track lead commissions using the ‘onBeforeFormSubmit’ function. Need assistance? Contact us. Explore integrations or create a free account.
Besides other features, HubSpot offers you a way to track custom forms. The integration of these forms will help you track lead commissions.
The integration uses the form’s ‘onBeforeFormSubmit’ function.
The standard form code looks like this:
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
hbspt.forms.create({
portalId: "1234567",
formId: "123c30ab-f09e-4c9a-ae7f-123e456f7f89"
});
</script>
The sale (lead) tracking code will be placed to the ‘onBeforeFormSubmit’ function mentioned above, like this:
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
hbspt.forms.create({
portalId: "1234567",
formId: "123c30ab-f09e-4c9a-ae7f-123e456f7f89",
onBeforeFormSubmit: function ($form, submissionValues) {
var email = '';
submissionValues.forEach(function(currentValue, index, arr){
if (currentValue.name == "email") {
email = currentValue.value;
}
});
var sale = PostAffTracker.createSale();
sale.setOrderID(email);
sale.setProductID('__Form name/Id here__');
sale.setData1(email);
PostAffTracker.register();
}
});
</script>
In case you need help with this sale/lead tracking code, feel free to get in touch with us.
Do not forget this important step. The code added to HubSpot forms requires the click tracking code to be present in the same page. Add the click tracking code anywhere to the page with your HubSpot form – it does not matter if you place it before or after the HubSpot form’s code.
The integration uses HubSpot’s ‘onBeforeFormSubmit’ function to track custom form submissions and lead commissions in Post Affiliate Pro.
You need to add a tracking script to the onBeforeFormSubmit function of your HubSpot form, which captures the lead email and registers the sale in Post Affiliate Pro.
Yes, you must include the click tracking code on the same page as your HubSpot form to ensure all affiliate clicks are tracked correctly.
If you need assistance with the sale or lead tracking code, you can contact the Post Affiliate Pro support team for help.
Lucia is a talented content editor who ensures the seamless publication of content across multiple platforms.
Experience seamless affiliate tracking and integration with HubSpot leads. Start your free trial today and optimize your affiliate network.
Would you like to improve your affiliate software even more? Check out the LemonStand integration for Post Affiliate Pro.
Would you like to improve your affiliate software even more? Check out the Fortune3 integration for Post Affiliate Pro.
Would you like to improve your affiliate software even more? Check out the ShopSite integration for Post Affiliate Pro.