This post is made in collaboration with Gravity Perks user Guilamu. Guilamu generously reached out to share how he used Gravity Forms Progress Meter to build a petition plugin for his non-profit organization, so we worked together to share his method with the world.
As a non-profit tech worker I often get asked to create petitions to raise awareness about a specific issue.
Until recently, there were no robust solutions out there to create such a petition with Gravity Forms. I had to use external websites like change.org. Then, I found the free Gravity Forms Progress Meter plugin and I was able to create and integrate a fully featured Gravity Forms petition directly in my WordPress site. And now, I’m going to show you how. 😁
Here’s the list of features this petition will explore.
- A progress bar displaying how many people have signed your petition.
- Multiple goals — so when you reach 10 signatures, the goal count will auto increment to the next goal you set up.
- A shortcode to display the number of signatures anywhere on your site.
- A simple means to email all users who signed your petition.
Creating an online petition using Gravity Forms
The Gravity Forms Progress Meter plugin lets you track submissions towards a goal. It does this by allowing you to add attributes to Gravity Forms shortcodes for displaying things like submission count, the name of your goal, and dynamically displaying the percentage to a goal.
The shortcode might look something like this:
[gravityforms id="211" action="meter" count_label="%d signatures so far." goal_label="Let’s get this to %d signatures!" goal="5;10;50;100;200;300;500;750;1000"]
This will generate a progress meter at the top of your form with a first goal of 5 signatures. As soon as the 5 signatures are in, a new goal will be set to 10, etc. These incremental goals are managed through the semicolons you see in the
goal value above.
Here’s an overview of the parameters inside:
- id — a Gravity Forms ID that will be the data source.
- action — the action that will be performed. We’ll use
meterto add a progress meter.
- count_label — the label display for the submission count. It must include
%dto include the count.
- goal_label — the label display for the goal amount. Must include
%dto include the count.
- goal — specifies the goal amount for the progress meter. Multiple goals are supported by adding multiple goal amounts separated by a semi-colon.
$%d? This is what the plugin uses to know where to insert the submission count and goal count.
By customizing each, you can fine-tune your petition’s goals, totals, and messaging.
Here’s a quick example using the same shortcode above. Some super important context: a few Hobbits are petitioning to have Bilbo Baggins give up the one ring to rule them all and cast it into the fires of Mount Doom. 🧙
Display Gravity Forms petition signatures anywhere
Here’s ChatGPT’s “funniest” joke on petitions:
“Why did the person’s online petition to stop procrastination fail?
Because they kept putting off promoting it!”
Is it funny? Debatable. But promoting your petition is important! Displaying your petition count elsewhere on-site can be helpful in sparking attention.
Once you have your petition and submission tracking in place, you can display the submission count elsewhere using the Gravity Forms Display Number of Entries Shortcode.
Don't you want to join the [gravityforms action="entry_count" id="42"] hobbits (and counting!) who want the ring destroyed?
- action — the specified action for Gravity Forms, which we use to tell Gravity Forms to display the entry count (previously, we used the
actionattribute to display a meter).
- id — input your form ID to display the number of entries for that form.
Our petition for Bilbo has five signatures. Here’s how the above shortcode would display:
Taking it further: email anyone who has submitted your petition
If you need to follow up with anyone who has signed your petition (for example, sharing a reached goal or outcome), Gravity Forms Email Users makes this a cake walk.
To do this, install Email Users and it will add an option in the Gravity Forms menu to email all submission entries. To learn more about how to do this — check Email Users’ guide on emailing Gravity Forms submissions.
And that’s all there is to it. Happy petitioning!