This instruction assumes that you have already installed either GA Connector WordPress plugin, or GA Connector script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<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> |
Now that you’ve installed our script, you need to make modification to your forms. There are two methods of integrating your forms with GA Connector:
Integration Method #1
Step 1: Add hidden fields with specific names to your forms
GA Connector script will automatically fill them out with users’ source, medium, keywords, location etc. Names of these fields help GA Connector script understand where to put the values.
Here is the list of fields you need to add to your forms:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<input type="hidden" id="fc_campaign"> <input type="hidden" id="fc_channel"> <input type="hidden" id="fc_content"> <input type="hidden" id="fc_landing"> <input type="hidden" id="fc_medium"> <input type="hidden" id="fc_referrer"> <input type="hidden" id="fc_source"> <input type="hidden" id="fc_term"> <input type="hidden" id="lc_campaign"> <input type="hidden" id="lc_channel"> <input type="hidden" id="lc_content"> <input type="hidden" id="lc_landing"> <input type="hidden" id="lc_medium"> <input type="hidden" id="lc_referrer"> <input type="hidden" id="lc_source"> <input type="hidden" id="lc_term"> <input type="hidden" id="OS"> <input type="hidden" id="GA_Client_ID"> <input type="hidden" id="gclid"> <input type="hidden" id="all_traffic_sources"> <input type="hidden" id="browser"> <input type="hidden" id="city"> <input type="hidden" id="country"> <input type="hidden" id="device"> <input type="hidden" id="page_visits"> <input type="hidden" id="pages_visited_list"> <input type="hidden" id="region"> <input type="hidden" id="time_zone"> <input type="hidden" id="time_passed"> <input type="hidden" id="latitude"> <input type="hidden" id="longitude"> |
Each hidden field needs to have a distinct attribute that would allow the script to understand which field is which. In the example above, it’s id.
But it can also be a name:
1 |
<input type="hidden" name="lc_source"> |
Or class:
1 |
<input type="hidden" class="lc_source"> |
Note: If your form doesn’t allow you to modify its ID, name, or class attribute, you can integrate your form with GA Connector using default values instead. Read More.
Step 2: Connect your new hidden fields to CRM fields
Now that you’ve added hidden fields to your forms, GA Connector script will automatically fill them out with tracking data.
The final step is to connect these hidden fields with your CRM fields. You need to modify the code that sends data to your CRM, and make it so that it also sends these new hidden fields (alongside your users’ email, name etc).
Integration Method #2
You can also integrate your forms without adding hidden fields, if your forms allow you to edit the code that submits them.
In that case, you can do it on the server side, using PHP, C#, Python or another language you use on the server. You can write some code that appends cookie values from screenshot 1 to the form submission, before sending it to the CRM.
Something like this:
1 2 3 4 5 |
$submission = $_POST; $submission['Last Click Source'] = $_COOKIE['gaconnector_lc_source']; $submission['Last Click Medium'] = $_COOKIE['gaconnector_lc_medium']; //... send_to_crm($submission); |
More than just UTM parameters
GA Connector adds UTM information, geolocation, referral information to your custom forms.
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.
[table “9” not found /]