Support » Plugin: HandL UTM Grabber » Contact Form 7 form submission hangs when UTM Grabber plugin is enabled

  • Resolved wpkmi

    (@wpkmi)


    Hello! Thank you for sharing this very useful plugin.

    I am trying to keep track of UTM data and send it when a lead submits a form on our website. I’ve found that when a cookie with UTM data exists and I try to submit a contact form, the sending icon spins and spins, never presenting a ‘message sent successfully’ message to the user.

    https://wordpress.org/plugins/handl-utm-grabber/

Viewing 14 replies - 1 through 14 (of 14 total)
  • I turned on debugging, here are the PHP errors when form submission doesn’t work:

    [08-Jan-2016 16:52:49 UTC] PHP Parse error:  syntax error, unexpected 'LMS' (T_STRING) in /var/www/wordpress/wp-content/plugins/handl-utm-grabber/handl-utm-grabber.php(28) : runtime-created function on line 1
    [08-Jan-2016 16:52:49 UTC] PHP Parse error:  syntax error, unexpected 'Ad' (T_STRING) in /var/www/wordpress/wp-content/plugins/handl-utm-grabber/handl-utm-grabber.php(28) : runtime-created function on line 1
    [08-Jan-2016 16:52:49 UTC] PHP Parse error:  syntax error, unexpected 'LMS' (T_STRING) in /var/www/wordpress/wp-content/plugins/handl-utm-grabber/handl-utm-grabber.php(28) : runtime-created function on line 1

    Looks like it is not handling spaces (%20) in the UTM data properly.

    Plugin Author Haktan Suren

    (@haktansuren)

    Thanks for reporting it. I am working on the new release. I will let you know when it is deployed.

    Plugin Author Haktan Suren

    (@haktansuren)

    Thanks for reporting the issue wpkmi. Can you please try updating the plugin to the latest (v1.2 as of now). It should fix the problem you are having. Please also let us know how it goes. Thanks!

    This is great, everything is working great now! Thanks so much!

    For anyone interested is using this plugin with contact form 7, simply add the following code to your themes function.php file:

    add_filter( 'wpcf7_form_elements', 'mycustom_wpcf7_form_elements' );
    
    function mycustom_wpcf7_form_elements( $form ) {
            $form = do_shortcode( $form );
    
            return $form;
    }

    Then to your form add:

    [utm_campaign_i]<input type="hidden" name="utm_campaign" value="%s" />[/utm_campaign_i]
    
    [utm_source_i]<input type="hidden" name="utm_source" value="%s" />[/utm_source_i]
    
    [utm_term_i]<input type="hidden" name="utm_term" value="%s" />[/utm_term_i]
    
    [utm_content_i]<input type="hidden" name="utm_content" value="%s" />[/utm_content_i]
    
    [gclid_i]<input type="hidden" name="gclid" value="%s" />[/gclid_i]

    And to collect the data, on the mail tab add this to your email message:

    Campaign Name:
    [utm_campaign]
    
    Campaign Source:
    [utm_source]
    
    Campaign Term:
    [utm_term]
    
    Campaign Content:
    [utm_content]
    
    Campaign GclickID:
    [gclid]
    Plugin Author Haktan Suren

    (@haktansuren)

    I am glad it worked for you as well.

    Thank you so much for sharing the code implementing HandL UTM Grabber with Contact Form 7.

    ((( HI.
    I can not understand how to do it . I am newbie. Maybe there is a turn-based installation screenshots. CF7!

    Hi Riskoff,

    Is the data not being collected when a form is submitted? Have you verified that the cookie data is there in your browser session?

    I do not know how to integrate it into the CF7. I can not figure out how to make a hidden field

    To add the hidden fields, got to contact forms -> edit your desired form -> on the “form” tab where you configure your fields such as [text name], [email email], etc add the following code to the bottom of the form:

    [utm_campaign_i]<input type="hidden" name="utm_campaign" value="%s" />[/utm_campaign_i]
    
    [utm_source_i]<input type="hidden" name="utm_source" value="%s" />[/utm_source_i]
    
    [utm_term_i]<input type="hidden" name="utm_term" value="%s" />[/utm_term_i]
    
    [utm_content_i]<input type="hidden" name="utm_content" value="%s" />[/utm_content_i]
    
    [gclid_i]<input type="hidden" name="gclid" value="%s" />[/gclid_i]

    Hello! That’s what I ‘m doing . But I have these fields visible in the text displayed on the site .
    My mail [redacted]
    I am able to throw off the screens

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    @riskoff, Please don’t attempt to contact people off the forums.

    Riskoff,

    Did you add the necessary code to your theme’s function.php file?

    add_filter( 'wpcf7_form_elements', 'mycustom_wpcf7_form_elements' );
    
    function mycustom_wpcf7_form_elements( $form ) {
            $form = do_shortcode( $form );
    
            return $form;
    }
    Plugin Author Haktan Suren

    (@haktansuren)

    Just would like to announce that as of v2.1, HandL UTM Grabber supports having shortcode in CF7. Special Thanks to @wpkmi

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Contact Form 7 form submission hangs when UTM Grabber plugin is enabled’ is closed to new replies.