How to Track Submissions from Custom Forms (Developer Guide)
This feature is only available in the Pro version of Independent Analytics.
If you are building a site for a client and you’ve coded your own forms, then you won’t find an automatic integration available to track submissions. However, it is possible to add automatic tracking for forms you develop yourself, and it’s easy too!
All you have to do is trigger the iawp_custom_form_submissions hook after a submission is completed by your form, like this:
The second argument is the form’s ID, which must be an integer. The third argument is the name of the form and must be a string.
The ID is used to recognize the form, so you can place it on multiple pages and have all submissions recorded as the same form. The title will be displayed inside the analytics interface. Once you have at least one submission recorded, you’ll see it appear in the Toggle Stats modals for the Quick Stats and data table.
When testing submissions, please make sure that you’re being tracked, or the submission won’t be recorded. You may need to visit your site in a private browser tab or enable tracking of logged-in visitors.
If you are a plugin developer, please email us, and we’ll be happy to add an official integration for your plugin. The hook described here is recommended for developers building custom form solutions for their clients.
If you’re worried about how much analytics data may be stored in your database, you can tell Independent Analytics to automatically delete old data. This will limit the total amount of data stored.
To enable this feature, visit the Analytics > Settings menu and scroll down until you see the Automatically Delete Old Data section.
To enable this feature, click on the dropdown that says, “Keep data forever,” and choose how long you’d like to store data.
Once you’ve selected how long you want to store data, click the Save button. You’ll see this popup appear asking you to confirm your selection:
Data older than the time period you selected will be deleted immediately. This process may take a few seconds or even as long as a minute or two, depending on how much data is being deleted.
Once the deletion is finished, you’ll see this notice informing you that old data will now be deleted routinely at midnight every day. This ensures that you only retain data for the specified time period.
The available time periods are:
30 days
60 days
90 days
180 days
1 year
2 years
3 years
4 years
If you leave this setting as “Keep data forever,” none of your data will be deleted.
If you install Independent Analytics and see the message below, it means your database prefix is longer than 25 characters.
This can cause the tables created by Independent Analytics to exceed the 64-character limit enforced by MySQL. For that reason, it is required to shorten the DB prefix to less than 25 characters before using Independent Analytics.
The good news is that changing your DB prefix doesn’t require any technical skill, thanks to a very helpful plugin called Brozzme DB Prefix & Tools Addons.
Once you install this free plugin, you’ll find a new settings menu like this:
All you have to do is enter a new prefix into the New Prefix field and click the Change DB Prefix button.
The prefix can be anything you want, as long as it’s less than 25 characters. It’s also a standard convention to end it with an underscore.
Once the prefix is changed, revisit the Analytics menu and you should see the full dashboard load right away.
The chart plots your metrics over time, allowing you to quickly spot trends.
By default, it will display your Visitors and Views:
If you click on the first dropdown, you’ll see that you can display any of your site’s metrics:
Pro users can also select metrics from WooCommerce and forms.
If you select the second dropdown, you’ll have access to all the same metrics, plus the option to display nothing at all, allowing you to view just one metric in the chart.
The axis on the left corresponds to the first metric and the axis on the right to the second.
Lastly, if you save the report, your changes to the chart will be saved as well.
How to change the interval
When you first view the analytics dashboard, it displays data from the last 30 days, and the chart uses a daily interval.
However, if you change the date range, the chart interval will automatically adapt. For instance, if you change the date range to Today, the chart will switch to an hourly interval:
If you switch to a date range with more than 90 days, the chart will switch to a monthly interval:
While the chart changes its interval automatically, you can also edit it manually with the interval select:
You can select between the following four intervals:
Hourly
Daily
Weekly
Monthly
You can choose any of these intervals manually, regardless of the current date range.
This feature is only available in the Pro version of Independent Analytics.
Unlike the dedicated form plugins, Bricks Builder forms cannot be tracked automatically. However, there are just a few simple steps required to track every submission.
To track submissions for a Bricks Builder form, start by clicking on the form in the editor and then opening the Fields section.
Add a new hidden field and give it a name attribute called iawp-form-id. The value can be anything you want. The label can also be anything, but you can use “ID” for clarity.
The name must exactly match “iawp-form-id”
Next, add a second hidden field and give it a name attribute of iawp-form-title. The value of this field is important as it’s the title that will show up in the Analytics menu. The label can be anything, but “Title” is clear.
The name must exactly match “iawp-form-title”
Lastly, open the Actions section and add a new Custom action.
Once these steps are done you can save your changes.
To test, make sure you visit via a logged-out browser window so that your activity is tracked and submit the form. The form will be available in the Quick Stats once a submission has been recorded.
“Contact Form” came from the value of the “iawp-form-title” hidden field
Additional tips
You can track as many forms as you want this way. If you want to track a second form, just add the hidden inputs with the iawp-form-id and iawp-form-title name attributes, and give them new values to differentiate them from the first form.
Now, let’s say you have a contact form, and you want to add it to two pages of your site and track them as the same form. To do this, you just have to make sure that the value of iawp-form-id is the same in both forms. The ID tells Independent Analytics that both forms are the same.
Lastly, let’s imagine you make a mistake and title the form “Conact form.” To correct it, you can simply update the value of the iawp-form-title field. The name will update in the Analytics menu the next time a form submission is tracked.
This feature is only available in the Pro version of Independent Analytics.
If you purchased an annual license, then it is set to auto-renew by default. You will receive an email a week before the renewal reminding you of the upcoming payment.
If you’d prefer to cancel your subscription, start by logging into your account here.
Your password was sent to you in the purchase receipt email, but if you have lost the email, you can use the “Lost password” link to set a new password.
Once logged in, click on Renewals & Billing in the sidebar. Then click on your subscription, and in the overlay menu, click the Cancel Auto-Renew link.
When your license expires, Independent Analytics Pro will be downgraded to the free version. This means your stats will continue tracking, but you will lose access to all Pro features and new updates.
If a visitor clicks on your ad in a Google results page, the referrer will be recorded as Google Ads. If they click on an ad displayed on another site through Google’s ad network, the visit will be recorded as Google Display Network.
This makes it easy to separate your paid Google traffic from your organic Google traffic.
Traffic from Google ads is distinguished by the gclid URL parameter that Google includes in all ad links.
How to track individual ads
If you’d like to see the performance of individual ads, you can do that with the Campaign tracking feature in Independent Analytics Pro.
The Campaign Builder allows you to create links with UTM parameters and use them in your ads. When someone clicks on one of these links, you’ll see the visit appear in the Campaigns report.
The benefit is that you can see exactly how many visitors you get from each link. Even better, if you are using WooCommerce or if you’re tracking form submissions, you can see how many conversions you get from each ad.
Google Ads does not automatically add UTM parameters to the ad URLs. You can add them using a tracking template.
This feature is only available in the Pro version of Independent Analytics.
If you are not receiving the email report, there are a few steps you can take to debug and resolve this issue. We’ll also cover smart techniques for improving deliverability later in this tutorial.
How to debug the email
Please start by using the Send test email button to attempt a delivery of the email report. If you do not receive the email, continue with the following debugging steps.
Check the spelling of the email address
First, make sure you have the correct email address entered with the proper spelling.
Check your spam folder
If the email address is spelled correctly, check your spam folder to see if the email arrived there instead of your inbox.
Check if other emails are being sent by WordPress
Try sending a password reset email to check if any emails are being delivered from your website. You can do this quickly by opening your site in a private browser window and navigating to the login screen.
The password reset email is sent by WordPress core, so if you don’t receive this email, you can rule out any plugin bugs.
Configure an SMTP plugin
If you didn’t receive the password reset email, then you may need to configure an SMTP plugin in order to deliver emails from your site. We recommend WP SMTP, which is easy to use.
Using an SMTP plugin is generally a good idea because it will improve the deliverability of all emails sent from your website.
Install WP Mail Logging
If you configure an SMTP plugin and your site still isn’t sending emails, try installing the WP Mail Logging plugin. It will track every email sent by your website and will report on any configuration issues. It may highlight an issue with the SMTP configuration that you can quickly solve.
Check if cron events are working
If the test email works, but the scheduled email isn’t sending, your site might not be firing cron events. You can install the WP Crontrol plugin and then navigate to the Tools > Cron Events menu. If the cron system has been disabled, you will see warnings next to every scheduled task, including the iawp_send_email_report task that IA uses.
If you see warnings about missed events, then your site has likely disabled the cron system. Check your wp-config.php file and delete the following line of code to re-enable it:
define('DISABLE_WP_CRON', true);
Alternatively, you can leave the cron system disabled and instead enable cron events via your hosting account. This can be more reliable, and we have more notes on how this works further down in this article.
Contact your host
If you are still not able to get emails sent from your site, please contact your web host, and they should be able to help resolve the issue.
Enable debugging
If you received the password reset email, then this means there is not a sitewide issue with sending emails. In this case, please enable error logging on your website. Then, try sending a test email one more time and check if you see a new error message in the /wp-content/debug.log file. If you see an error pointing to our plugin, please share it with us at support@independentwp.com, and we will help resolve the issue.
How to further improve deliverability
If your email report is going to the spam folder or sending later than scheduled, there are a few steps you can take to remedy these issues.
The steps below will improve the deliverability of all emails sent by your website.
Add SPF and DKIM records
Your emails are more likely to end up in the spam folder if your domain doesn’t have SPF and DKIM records configured. This is especially true if you are sending the email report to multiple email addresses.
The SPF and DKIM DNS records help verify the content and sender of the email, improving deliverability. Google has a brief explainer video that sums them up well:
Adding these records will help all of your site’s emails avoid the spam folder, and it also improves protection against phishing attacks.
Use real cron events
A cron event is basically a scheduled task, and it’s the underlying technology used to send the email report. WordPress has a built-in cron system that tons of plugins use, and it makes it easy to schedule upcoming events.
However, the cron system run by WordPress isn’t a true cron system. For WordPress to run a scheduled event, it has to get loaded. For example, if there is an event scheduled for 5pm and nobody loads a page on your site at 5pm, the event won’t get triggered. Instead, if someone visits by 5:02pm, that’s when the event will run.
For this reason, scheduled events may run a few minutes late, but they can sometimes run much later.
If you have a new website with a small amount of traffic and an event is scheduled for 1am, it may not get triggered for hours. When this happens, cron tasks can get backed up, and then some of them may not run at all. This could prevent the email report from getting sent.
While this isn’t as much of an issue for high-traffic sites, it is always better to use a real cron system. Many web hosts will enable true cron events if you request it. Just ask them to disable WP Cron and use real cron events, and they should be able to set it up for you.
If that’s not an option, you can use a service like Easy Cron instead. It can trigger the site’s cron events every 20 minutes on the free tier, which should be enough to prevent any build-ups. They even have a plugin that makes setup easier.
With real cron events configured, the email report will be delivered precisely at the time selected.
This feature is only available in the Pro version of Independent Analytics.
Independent Analytics Pro integrates with the following plugins:
Contact Form 7
WPForms
Gravity Forms
Fluent Forms
MailPoet
Mailchimp for WordPress
Ninja Forms
Bit Form
Newsletter
Formidable Forms
Bricks Builder
Divi
Elementor Pro
Avada Forms
MailOptin
SureForms
Forminator
Kadence Blocks
WS Form
Everset Forms
Convert Pro
Hustle
JetFormBuilder
Kali Forms
Thrive Leads
Amelia
ARForms
WP Store Locator
Bricks Builder forms require a few configuration steps: read the guide
Kadence Blocks forms can be tracked only if they’re created via the Forms menu in Kadence. Forms created with a block within the post editor are not trackable.
Can other plugins be added?
Yes, if you’re using another plugin you’d like us to integrate with, please get in touch, and we’ll see if it’s possible.
After installation, Independent Analytics Pro will automatically track submissions of any form created by one of the supported plugins. There is no configuration required beyond installing Independent Analytics Pro and using a supported plugin to create your forms.
There are two places where you can find stats for your form submissions.
Form stats in the Quick Stats
Above the Quick Stats, you’ll see the Toggle Stats button.
Click this button, and then in the modal that appears, select the Forms section.
Here, you can see all the form metrics available. There is an overall Form Submissions metric and Form Conversion Rate metric. These give you the total values for all your forms combined.
Below that, you’ll see the title of the form plugin you’re using and the metrics for each individual form. In the example above, you can see submission and conversion rate metrics for a “Contact Us” form and a “Lead Gen” form.
Please note that you will not see all the forms listed immediately. Forms will only show up after at least one submission has been recorded.
You can check any of these boxes, and the associated stat will appear in the Quick Stats right away.
Stats that come from a plugin will also show the plugin’s logo
You can show/hide whichever stats you’d like, and if you want to revisit this data quickly in the future, you can save a new report. This will save every change you’ve made, including your customizations to the Quick Stats.
The stats update with any filters applied, so you can easily see data like your submissions that came from social media sites or cities in Canada.
Form stats in the data table
Another place you can find the form stats is in the data table. Just like the Quick Stats, you can click the Toggle Columns button and choose which form metrics you want displayed.
This gives you more granular data than the Quick Stats. For instance, you can compare the number of submissions between individual traffic sources in the Referrers report.
This data is available in all reports, so you can also see each form’s stats for individual cities and countries, device types, browsers, and UTM campaigns.
Does the form have to come from a plugin?
Yes, the form needs to be created with a WordPress plugin. Form plugins save the forms in the DB with names and IDs, which Independent Analytics uses to recognize and differentiate between forms regardless of which page they’re on.
The main advantage is that you don’t have to configure anything yourself. However, it also means that you can update a form’s title and it will update automatically in the analytics, and you can embed the same form in multiple places, and it will be tracked as the same form.