How to Integrate GA Connector with Brilliant Web-to-Lead for Salesforce WordPress plugin

The instructions below apply to Cookie-Based integration.

If you are using API-Based integration, 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 Brilliant Web-to-Lead for Salesforce with GA Connector’s Salesforce integration.

Prerequisites

  • These instructions assume that you have already connected Brilliant Web-to-Lead for Salesforce to your Salesforce account
  • 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>

How to find the API name of GA Connector field in Salesforce

Before setting up your form, you must first find and take note of the API name of the GA Connector field that you will be adding in your form.

  1. To find the API Name go to Setup > Object Manager > Lead > Fields & Relationships
  2. Find the GA Connector custom fields that you will be adding to your form and write down the field name.

Setting up your form

Once you have installed the script on your website and know the API name of your custom fields, we'll need to set up your form so GA Connector will able to fill this with tracking information.

  1. From your WP dashboard navigate to Settings > Salesforce > Forms, and select the form where you want to add GA Connector fields.
  2. Click on Add a Field.
  3. On the first column (Field column) enter the API name of the GA Connector custom field on Salesforce.
  4. On the values field, put in the equivalent GA Connector input ID (e.g. All Traffic Sources - gaconnector_all_traffic_sources, First Click Campaign - gaconnector_fc_campaign) - For a full list of GA Connector fields and equivalent input IDs see table below.
  5. Save Form

More than just UTM parameters

GA Connector adds UTM information, geolocation, referral information to your Salesforce 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 gaconnector_all_traffic_sources Last Click Campaign gaconnector_lc_campaign
Browser gaconnector_browser Last Click Channel gaconnector_lc_channel
City (from IP address) gaconnector_city Last Click Content gaconnector_lc_content
Country (from IP address) gaconnector_country Last Click Landing Page gaconnector_lc_landing
First Click Campaign gaconnector_fc_campaign Last Click Medium gaconnector_lc_medium
First Click Channel gaconnector_fc_channel Last Click Referrer gaconnector_lc_referrer
First Click Content gaconnector_fc_content Last Click Source gaconnector_lc_source
First Click Landing Page gaconnector_fc_landing Last Click Term gaconnector_lc_term
First Click Medium gaconnector_fc_medium Last Click Timestamp gaconnector_lc_timestamp
First Click Referrer gaconnector_fc_referrer Longitude gaconnector_longitude
First Click Source gaconnector_fc_source Latitude gaconnector_latitude
First Click Term gaconnector_fc_term Number of Website Visits gaconnector_page_visits
First Click Timestamp gaconnector_fc_timestamp Operating System gaconnector_OS
Google Analytics CID gaconnector_GA_Client_ID Device gaconnector_device
Google Analytics Measurement ID gaconnector_GA_Measurement_ID Region gaconnector_region
Google Analytics Session ID gaconnector_GA_Session_ID Pages Visited gaconnector_pages_visited_list
Google Click Identifier gaconnector_gclid Time Spent on Website gaconnector_time_passed
IP Address gaconnector_ip_address Time Zone gaconnector_time_zone