As WordPress developers specializing in Gravity Forms integration with MailChimp, efficiency for us is a best practice second only to security. We want to auto-populate Gravity Forms with the primary WordPress category and integrate with MailChimp groups, so our subscribers only receive notifications about articles in their category of interest at the time they subscribe.
On this website, we write about 3 related, but very different, topics – finding B2B leads on LinkedIn, capturing B2B leads using WordPress Gravity Forms, and customizing email auto-delivery using MailChimp Automation Workflows. While there is considerable crossover between these categories, the data shows that the vast majority of our readers are interested in only one topic at any given time.
Since we didn’t want to create a separate contact form for each WordPress category a visitor may be reading from, we opted to ‘teach’ Gravity Forms to recognize the WordPress category from which it’s form is being called. We use a single Gravity Forms contact form in multiple ‘Remind Me!’ popups and buttons that allow subscribers to sign-up for reminders.
Note: One custom Gravity Forms contact form means one set of tables and stats to track.
This means, if you subscribe while reading this article you will only receive notifications when new WordPress articles are published. That’s because the primary category for this article is ‘WordPress Development’. Nice.
Here’s how we accomplish this feat.
- Step 1 – Create a hidden Gravity Forms field named ‘primary_category’ in your subscription form, and make sure the ‘Allow field to be populated dynamically’ checkbox is checked.
- Step 2 – Update your functions.php file with the following code (modified to suit your needs).
Source: www.gravityhelp.com /documentation /article /gform_field_value_parameter_name/
WP.org: developer.wordpress.org /reference /functions /get_the_category/
- Step 3 – Create hidden MailChimps groups that align with your WordPress categories.
- Step 4 – Create Gravity Forms MailChimp feeds that align with your WordPress categories AND point to your MailChimp hidden groups when sending subscriber data to MailChimp.
- Step 5 – Create a separate RSS-to-Email MailChimp campaign for each WordPress category from which you wish to send.
This will require that you configure each RSS feed to obtain it’s data from a WordPress category on your blog (as shown below for the LinkedSEO ‘Web Development’ category).
Although all of our readers are really smart people, we presume a lot in this article. Some things you should know if you intend to configure you WordPress site in this way.
- Modifying your functions.php file without knowing what you’re doing can break your website really fast. We strongly recommend making these modifications on a dev copy of your website. And never on a production business website.
We use SiteGround, so we have a free staging area that allows us to push changes ‘live’ into production only after we test them out. Here’s a quick link to Why Your Web Host Reeally Matters, and the excellent customer service they provide. Just sayin’ (facepalm)
- Your taxonomies need to be ‘tight’ … that means flawless for you non-technical folks. LOL
If you’ve gone crazy with categories, this probably will not work well for you. You’ll end up needing waay too many MailChimp RSS-to-Email campaigns.
- Having more than one custom RSS-to-Email campaign on any email service provisioning platform can be a bit much to manage. Every change that needs to occur there will need to occur in each RSS-to-Email campaign. Fun.
- We use MailChimp as our choice of ESPs (email service providers), and specialize in customizing MailChimp Automation Workflows. That being said, the high-level steps outlined here are basically the same as long as your ESP allows groups and segments.
- Setting all this up AND testing will take hours … not to mention the Automation Workflows that should also be built to engage those subscribers. We schedule all of our work and usually turn around small projects like this within 10 business days.
If you decide to go-it-alone, just remember to backup your website before making any modifications. We do when we do work for you! 🙂