• Resolved weju

    (@weju)


    Hello,

    how to track a form sent with tag manager and analytics GA4 please ?

    After submission, i use “Hide the form after submission, and display a success message to the user.” and i don’t want use “URL de redirection “.

    Thanks for your response.

    Regards

    • This topic was modified 1 month, 3 weeks ago by weju.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Jair – WPMU DEV Support

    (@wpmudevsupport15)

    Hello @weju

    The Beehive plugin has integration to both Google Analytics/Google Tag Manager and Forminator. The settings are located at Beehive -> Settings -> Integrations and enable the setting “Forminator Forms”:
    https://wpmudev.com/docs/wpmu-dev-plugins/beehive/#integrations

    If after doing that you still encounter issues, check this workaround, specially if you are using the “Load using Ajax” option in the form’s Behavior settings:
    https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#form-data-not-sent-to-gtm

    Kind regards,
    Jair.

    Thread Starter weju

    (@weju)

    hello, ok thanks but install an other plugin just to track is not very conveniant. Is there an other solution to track without installing plugin ? use ajax ?

    thanks

    regards.

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @weju

    If you don’t want to use an additional plugin, you can use the following code snippet which is also available in our document:

    <?php 
    
    add_action('wp_footer', 'wpmudev_add_ga_event_submission', 9999);
    function wpmudev_add_ga_event_submission(){
    	global $post;
    	if ( is_a( $post, 'WP_Post' ) && !has_shortcode($post->post_content, 'forminator_form') ) {
    		return;
    	}
    	?>
    	<script type="text/javascript">
    	jQuery(function($){
    		$(document).on( 'forminator:form:submit:success', function(e, formData) {
    			dataLayer.push({event: "formsuccess", formData: formData});
    		});
    		$(document).on( 'forminator:form:submit:failed', function() {
    			dataLayer.push({event: "formfailed"});
    		});
    	});
    	</script>
    	<?php
    }

    You can add this as a mu-plugin and please make sure the form submission is set to ajax. You can read this document to learn more how to install the mu-plugin:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Best Regards
    Amin

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @weju,

    Since we haven’t heard from you for a while. I’ll mark this thread as resolved for now. Please feel free to re-open this thread if you need any further assistance.

    Best Regards,

    Nithin

    Thread Starter weju

    (@weju)

    hello,

    thanks for your tip but it’s too complicated just to track a form sent, i prefer track with a simple redirection as usual.

    I think you should implement that directly in your plugin, it’s somethinghigh demand.

    regards

    Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @weju,

    I hope you’re doing well.

    Thank you for your feedback.

    We’ve created a feature request for this, and our Forminator team will review it soon. I can’t promise when it will be implemented, but you can expect it in the future.

    If using the mu-plugin feels too complicated, we canprovide simple steps to add the script safely to your site.

    Please let us know if you’d like these clear instructions.


    Kind Regards,
    Imran Khan

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.