Hubspot integration cannot track activities
-
I did integrate with hubspot and input data can captured into hubspot field. However, contact captured in hubspot is cannot track activity so let’s say it’s not 100% integrate. as it doesn’t capture Form submission on hubspot. I test capture the form by hubspot form itself then activities on web can be tracked.
I have checked with hubspot document it said submit button should be <input> in stead of <button>i tried insert javascript to make <input>submit button then form submission appear in hubspot and then can be tracked. However, I need more solid solution from your support. Because plugin itself should be able to do100% integration.
The page I need help with: [log in to see the link]
-
Hi @dinbodeewv
I hope you’re well today!
I’m not quite sure what you mean by “activities on the web” here but if it’s about Forminator not sending data to Hubspot please note that integration is built-in into Forminator and it is not about putting some Hubspot form fields into the same page or into the Forminator form.
It doesn’t require any changes in button etc. The integration is via API and happens in background. You do not need any code from Hubspot and any additional JavaScript for that.
What you do need, however, is to
1. correctly enable and configure integration on the “Forminator -> Integrations” page first so Forminator would be able to connect to HubSpot API and communicate with it
2. And then add and configure such integration to a particular form in form’s “Integrations” settings.
Both these steps are very important but the second one also determines if and what form fields will be captured and send to HubSpot and where to in HubSpot they will be send.
I’m not sure how you configured that but please take a look at this guide and make sure that you follow it:
https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#hubspot
Make sure to follow that guide up to the point and test the form again. If it still doesn’t work correctly after that, let us know, please.
Kind regards,
AdamHI Thanks for reply but i think you still don’t understand the point.
I did integration and data from forminator record into Hubspot beautifully.
Normally hubspot can track activities on web like which pages user visit after contact were captured. But in this case it just end where new contact create in forminator and that’s it. Can check screenshot here: forminator capture contact in hubspot – justpasteit
First is when original forminator integrate into hubspot. it didn’t capture as form submission. next image is after I insert javascript to change button into <input> add convert javascript forminator – JustPaste.it
You can see from hubspot doc itself for there guideline Use non-HubSpot forms in Requirements to capture non-HubSpot form submissions . state that “The form must use a standard <input type=”submit”> button for its form submissions.”Hope this is more understandable.
Din
Hi @dinbodeewv
Thanks for the update.
This is expected, the Forminator will only merge the data to the contact fields and fill them, the tracking is something different not depending on the integration, it listens to the “form” tag to be able to track the submission, set a cookie to browser then monitor the user.
In case it works with input, you can try the following code:
<?php add_filter( 'forminator_render_button_markup', 'wpmudev_render_submit_button', 10, 2 ); function wpmudev_render_submit_button( $html, $button ) { $html = '<input class="forminator-button forminator-button-submit" type="submit" value="' . $button . '" />'; return $html; }Add it as a mu-plugin https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins then no JS script is required to modify the front end.
Let us know if it works for you.
Best Regards
Patrick FreitasHello @dinbodeewv ,
You haven’t gotten back to us so it looks the above code did the job for you 🙂
In this case I’ll mark topic as resolved.
kind regards,
KasiaHi, WPMU support,
I was busy with other fucnctions and just manage to try your solution today. However, it still doesn’t work. I’ve checked in html inspect after install mu plugin bu the button is not change to input and hubspot still cannot see form submission then no activities track on hubspot.
Do you have any suggestion?
Din
I think i know why. may be because my form use page break. so plugin code didn’t find submit button when loaded.
I try remove page break, now button become input and form submission can be track in hubspot.Bu t now we need another solution for form with page break. could we change some code in mu plugin in this case?
Thank you ,
Dinn
Hi @dinbodeewv,
Hope this message finds you well.
I tested the code using the Page Break field and I can confirm it doesn’t work.
In such case, we checked with our Devs about if a different solution could be provided. We can’t guarantee a workaround, but if there is any, we will let you know once we get a reply from the team.
Best regards,
LauraHi, It’s been a while. any luck for solution to solve this issue? I really need it to be done.
Regards
Hi @dinbodeewv
I just got response from our developers about a workaround for the issue.
Please try adding this code to the site:
<?php add_action( 'wp_footer', 'wpmudev_submit_button_change', 9999 ); function wpmudev_submit_button_change() { global $post; if ( is_a( $post, 'WP_Post' ) && !has_shortcode( $post->post_content, 'forminator_form' ) ) { return; } ?> <script type="text/javascript"> jQuery(document).ready(function($){ setTimeout(function() { $('.forminator-custom-form').trigger('after.load.forminator'); },100); $(document).on('after.load.forminator', function(e, form_id) { if ( e.target.id == 'forminator-module-6' ) { // Please change the form ID. $( document ).on( 'forminator.front.pagination.move', function( e ) { setTimeout(function(){ var submit_text = $( document ).find( '.forminator-button-submit' ).html(); $( document ).find( '.forminator-button-submit' ).replaceWith( '<input type="submit" class="forminator-button forminator-button-submit" value="'+submit_text+'" id="forminator-submit"/>' ); $( document ).find( '.forminator-button-back' ).css( 'order', '0' ); },200); }); } }); }); </script> <?php }To add it:
– create an empty file with a .php extension (e.g. “forminator-hubspot-paging-patch.php”) in the “/wp-content/mu-plugins” folder of your site’s WordPress install on the server
– copy and paste that code into it
– in this line of the code
if ( e.target.id == 'forminator-module-6' ) { // Please change the form ID.replace number 6 with your form ID; form ID is the number you see in form shortcode.
– save the file.
It should work out of the box then.
Kind regards,
AdamOk, button turn into input now, thank you. but i have many of my form using pagination. what should i add in this case? or are there a way to include to all forminator forms?
Hi @dinbodeewv
If you want to target more forms with above code, please change
if ( e.target.id == 'forminator-module-6' ) {to
if ( e.target.id == 'forminator-module-6'|| e.target.id == 'forminator-module-7' || e.target.id == 'forminator-module-8') {and change 6, 7, 8 to your forms IDs and repeat the process of
|| e.target.id == 'forminator-module-8'depending on how many forms you have.
Kind Regards,
Kris
The topic ‘Hubspot integration cannot track activities’ is closed to new replies.