Quantcast
Channel: Snippets Archives - Gravity Wiz
Viewing all articles
Browse latest Browse all 196

Simple Split Testing with Gravity Forms

$
0
0

Matt Medeiros wrote an awesome article about A/B Testing with Gravity Forms (also known as split testing). Matt shared a small function which accepts two Gravity Form IDs. The provided form IDs are randomly alternated so each form is displayed about half of the time. A handy little function!

Feeling a bit inspired, I thought it might be easier for user’s to implement if this were available as part of the [gravityform] shortcode. I also figured it couldn’t hurt to add support for more than two forms.

View this code snippet on GitHub.

How do I get started?

  1. Copy and paste the snippet into your theme’s functions.php file.
  2. Configure the shortcode via the instructions below.

The Shortcode

[gravityform action="split_test" ids="1,2" /]

Shortcode Parameters

  • action
    Use “split_test” to activate the split test functionality.
  • ids
    A comma-delimited list of form IDs which should be displayed.

Function Call

If you need to implement this in a template file or other advanced usage, you can make use of the function call.

View this code snippet on GitHub.

Function Parameters

  • $form_ids (array) An array of form IDs that should be randomly alternated for display.
  • $attributes (array) An array of settings used to configure form properties. Settings include:
    • title: (bool) Whether to display the form title. Defaults to true.
    • description: (bool) Whether to display the form description. Defaults to true.
    • ajax: (bool) Whether to enable AJAX for the displayed form. Defaults to false.
    • tabindex: (int) The starting tab index for displayed form.

Basic Usage

In this example, we pass form IDs “1″ and “2″ to the split testing function.

View this code snippet on GitHub.

Advanced Usage

In this example, we pase form IDs “1″ and “2″ and set the title, description and ajax options.

View this code snippet on GitHub.

How do I measure the effectiveness of the forms?

Gravity Forms has built-in conversion tracking for all your forms. You can see how many views each form has and how many entries. In the far right column, you can see the “Conversion” percentage. The higher the percentage the more effective the form is at getting users to fill it out.

split-testingExample of Gravity Forms Forms List View Conversion Column

Summary

For more details on the benefits of split testing, make sure you check out Matt’s original article.

Have suggestions to improve this functionality? Let me know in the comments!


Viewing all articles
Browse latest Browse all 196

Latest Images

Trending Articles



Latest Images