How to integrate GA Connector with Agile CRM form builder

The instructions below apply to Cookie-Based integration.

If you are using API-Based integration, please note that Agile CRM Forms does not support it. You will need to follow the Cookie-Based integration steps instead.

Not sure which instructions to follow? Start here: How to Check Which GA Connector Integration Type You’re Using.

Add Google Analytics data to Agile CRM form builder with GA Connector’s Agile CRM integration.

Prerequisites

  • These instructions assume that you have already created custom fields in your Agile CRM. (For information on how to create custom fields in Agile CRM, please refer to this link.)
  • Installed either GA Connector WordPress plugin or GA Connector script on your website:
HTML
<script data-cfasync="false" type="text/javascript" src="https://tracker.gaconnector.com/gaconnector.js"></script>
<script>
function setGaconnectorHiddenFields() {
    var gaFields = gaconnector.getCookieValues();
    for (var fieldName in gaFields) {
        var selectors = 'form input[name="' + fieldName + '"], form input#' + fieldName + ', form input#field_' + fieldName + ', form input[name="' + fieldName.toLowerCase() + '"], form input#' + fieldName.toLowerCase() + ', form input#field_' + fieldName.toLowerCase() + ', input[value="gaconnector_' + fieldName + '"],';
        selectors += 'form textarea[name="'+fieldName+'"], form textarea#'+fieldName+', form textarea#field_'+fieldName + ', form textarea[name="'+fieldName.toLowerCase()+'"], form textarea#'+fieldName.toLowerCase()+', form textarea#field_'+fieldName.toLowerCase()+', form textarea.'+fieldName+', form textarea[name="param['+fieldName+']"]'+", form textarea[id^='field_"+fieldName+"']";
        var inputs = document.querySelectorAll(selectors);
        if (inputs === null) {
            continue;
        } else if (typeof inputs.length === 'undefined') {
            inputs.value = gaFields[fieldName];
        } else {
            for (var i = 0; i < inputs.length; i++) {
                inputs[i].value = gaFields[fieldName];
            }
        }
    }
}

gaconnector.setCallback(setGaconnectorHiddenFields);
setInterval(setGaconnectorHiddenFields, 1000);
</script>

Once you have installed the script on your website and have already created custom fields for GA Connector in your CRM, we'll need to set up your form so GA Connector will able to fill this with tracking information.

Set up GA Connector Fields on Form Builder

Step 1 On your Agile CRM dashboard, launch the Form Builder and select the form where you want to add the GA Connector fields.
To launch the Form Builder, go to Admin Settings > Integrations > Form Builder

Step 2 Add a hidden form on your form, set the ID to the equivalent input ID that is listed on the table below this page. (e.g. All Traffic Sources - all_traffic_sources, First Click Campaign - fc_campaign)
Set the Agile Field to the equivalent custom field that you have created.

Step 3 Save Form and add it to your website.

More than just UTM parameters

GA Connector adds UTM information, geolocation, referral information to your Agile CRM leads.

See below for all the information that you can add to your leads to help you find out which of your marketing activities drive sales.

Label Input ID Label Input ID
All Traffic Sources all_traffic_sources Last Click Campaign lc_campaign
Browser browser Last Click Channel lc_channel
City (from IP address) city Last Click Content lc_content
Country (from IP address) country Last Click Landing Page lc_landing
First Click Campaign fc_campaign Last Click Medium lc_medium
First Click Channel fc_channel Last Click Referrer lc_referrer
First Click Content fc_content Last Click Source lc_source
First Click Landing Page fc_landing Last Click Term lc_term
First Click Medium fc_medium Last Click Timestamp lc_timestamp
First Click Referrer fc_referrer Longitude longitude
First Click Source fc_source Latitude latitude
First Click Term fc_term Number of Website Visits page_visits
First Click Timestamp fc_timestamp Operating System OS
Google Analytics CID GA_Client_ID Device device
Google Analytics Measurement ID GA_Measurement_ID Region region
Google Analytics Session ID GA_Session_ID Pages Visited pages_visited_list
Google Click Identifier gclid Time Spent on Website time_passed
IP Address ip_address Time Zone time_zone