Support » Plugin: Form Abandonment Tracking » Contact Form 7 setting the form ID

  • Resolved DowntownRob

    (@downtownrob)


    To use this with Contact Form 7, you will need to add to the shortcode to set the form ID properly using “html_id” attribute:

    [contact-form-7 id=”1234″ title=”Contact form 1″ html_id=”your-ID-name-here” html_class=”form contact-form”]

    The “html_class” attribute can also be used to set custom CSS class values, as seen above as well.

    https://wordpress.org/plugins/form-abandonment-tracking/

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

    (@mktngguy)

    Hi Rob.

    Looks like a nice plugin, if I can get it to work ๐Ÿ™‚

    You said, quote: “To use this with Contact Form 7, you will need to add to the shortcode to set the form ID properly using html_id attribute…”

    But in the example code provided, it appears that the form ID is id=”1234″. Could you please clarify?

    Thanks. Looking forward to getting this to work properly.

    Thread Starter DowntownRob

    (@downtownrob)

    Sorry, yes, to clarify, id=”XX” in the shortcode will output the required html_id=”XX” code in the HTML.

    And html_class=”ZZZ” in the shortcode will output the div class=”ZZZ” in the HTML.

    The shortcode format is used to generate the proper HTML.

    mktngguy

    (@mktngguy)

    Thanks for the reply, Rob.

    I think there are 1 or 2 possible issues that may still prevent it from working properly for me:

    1. Shortcode settings.

    This is the default shortcode provided in Contact Form 7 to display the form on a page:

    [contact-form-7 id=”7″ title=”Contact form 1″]

    If I understand correctly, that default shortcode will not work with your plugin as is, but must be altered. Could you take a moment to show specifically what changes must be made to the default code (above) to get it to work? I’ve tried a number of variations using your example code above, but none have worked so far.

    2. I noticed in the HTML that for some reason there’s no form name defined in the form’s HTML like so:

    <form name=”” action=”/form-evaluation/#wpcf7-f68-p73-o1″ method=”post” id=”68″ class=”wpcf7-form” novalidate=”novalidate”>

    Do you know if that may have anything to do with the your plugin not working properly for me? Or do you have any other troubleshooting suggestions? (A Troubleshooting FAQ would be quite useful ๐Ÿ™‚

    I wouldn’t bother to ask your help if I didn’t consider this a very valuable tool. Thanks again for your help. It’s greatly appreciated.

    Note: To test the plugin, I’m doing form submissions and then checking under Real-Time > Events (Universal Analytics). It seems to show me in the stats as a visitor, but no events appear in the real-time stats.

    Thread Starter DowntownRob

    (@downtownrob)

    This plugin is not yet working under Universal Analytics, an update I’ll be pushing live soon will fix that.

    You’d add to the shortcode exactly as I showed, adding: html_id=”contact-form-name” into the shortcode, as the first post shows, so your shortcode:

    [contact-form-7 id=”7″ title=”Contact form 1″]

    would be edited to be:

    [contact-form-7 id=”7″ title=”Contact form 1″ html_id=”contact-form-name”]

    So in Google Analytics, “contact-form-name” would show up in the stats, give each of your forms a unique ID name.

    Not sure why form name doesn’t show up, I think it uses the form title, I’d refer you to the Contact Form 7 FAQ or docs, here’s more info on the form ID:

    Can I add id and class attributes to a form element?

    Also, please note, if the Google Analytics plugin is set to not track logged in users, then nothing will show up in real-time or in reports when you visit the site.

    mktngguy

    (@mktngguy)

    Thanks again, Rob.

    I didn’t see any mention of incompatibility with Universal Analytics. Wish I’d known that earlier; it’s probably why I haven’t been able to get it to work.

    I look forward to your release of the Universal Analytics compatible version.

    Hi Rob.

    Thanks for updating your plugin to work with Universal Analytics. I haven’t tested it yet, but I look forward to using it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Contact Form 7 setting the form ID’ is closed to new replies.