Gravity Forms

If you use Gravity Forms on your website please use this documentation to send conversions from your website to Ruler.

📘

Gravity Forms Version 2.9

Gravity Forms Version 2.9 is a major Gravity Forms update introduced in 2024. If you are using Gravity Forms Version 2.9 or later please use the script below to track conversions from Gravity Forms.

If you are using an earlier version of Gravity Forms, please email [email protected]

Apply this script to the footer of your website before the closing tags.

<script>
    if (typeof gform !== 'undefined' && gform.utils && typeof gform.utils.addAsyncFilter === 'function') {
        gform.utils.addAsyncFilter('gform/submission/pre_submission', function (data) {
            return new Promise(function (resolve, reject) {
                try {
                    var payload = {};
                    for (var i = 0; i < data.form.length; i++) {
                        var id = data.form[i].id ;
                        var value = data.form[i].value;
                        if (id && value) {
                            payload[id] = value;
                        }
                    }
                    try {
                        RulerAnalytics.trackConversionAsync(payload, "", "", 500);
                        resolve(data); 
                    } catch (error) {
                        resolve(data); 
                    }
                } catch (ex) {
                    resolve(data);
                }
            });
        });
    }
</script>

This script can be added to every page of your website, including pages that don't contain a Gravity Form.

You can add this script as a custom HTML tag using Google Tag Manager, If using GTM to implement the Script the tag trigger should be selected as the 'DOM Ready' trigger.

If applying directly to your site, add the code before the closing tag.

❗️

Script only compatible with Gravity Forms Version 2.9 or later

If you are using an earlier version of Gravity Forms, please email [email protected]