How to Make Forms Tracking Work With the Elegant Themes Divi Contact Form

Are you using Elegant Themes’ Divi Builder contact form and are trying to track your form’s performance with ExactMetrics? Forms tracking might not work right out of the box with Divi forms, but to fix this, all you need to do is use WPCode to insert a code snippet to add an ID attribute to your form elements.

Why is the Form ID attribute important?

By default, Elegant Themes forms do not have an ID included in their form markup, and as a result, ExactMetrics isn’t able to properly track form impressions and conversions. IDs are normally generated in other forms or opt-in plugins such as WPForms and OptinMonster.

This can be easily fixed by adding an ID attribute to the Elegant Themes Divi Build contact form’s markup with JavaScript code.

Note: When assigning your forms an ID, make sure each form has a unique ID number to make it easier to identify each of your forms when viewing reports.

Step 1: Install WPCode into your WordPress site by going to Plugins » Add New and searching for WPCode. Click on Install Now and Activate.


Step 2: Now look for Code Snippets in your WordPress menu and click on Header & Footer.


Step 3: Add the following custom code snippet in the Header section:

jQuery('.et_pb_contact_form').attr('id', 'your_id_here');

The ID attribute should be made up of lowercase letters, numbers, underscores, and dashes.

Once this is done, forms tracking will begin to work moving forward.

Once enough data has been collected, you’ll be able to view your forms report at ExactMetrics » Reports » Forms.

EM forms report

That’s all! Forms tracking will now work for your Elegant Themes Divi forms.

If you’re interested in using a different form solution, please see our guide on the best contact form plugins for WordPress.

Are you using the Elegant Themes’ Bloom plugin? Learn how to make Forms Tracking work with the Elegant Themes Bloom Plugin.