How to integrate GA Connector with Zoho Forms

GA Connector works with Zoho Forms in both integration types. The steps are different for each, so start by confirming which one your website uses.

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

The quick version: view your page source, search for gaconnector.js, and look at the subdomain. tc. or tracker. means Cookie-Based; ta. or track. means API-Based.

Add Google Analytics data to Zoho Forms with GA Connector’s Zoho Forms integration.

Prerequisites

  • Installed either the GA Connector WordPress plugin or the GA Connector script on your website.
  • Access to edit your Zoho Forms and your website’s HTML (or your GTM container).

Install the custom scripts on your website

  1. Add the following GA Connector script on all pages of your website. The script must be placed before your Zoho embed code, so adding it to your website’s <head> would work.
    Note: If you are already using the cookie-based version of GA Connector, you can skip adding this script.
    HTML
    <script data-cfasync="false" type="text/javascript" src="https://tracker.gaconnector.com/gaconnector.js"></script>
  2. Add the following script after your Zoho Form embed code.
    HTML
    <script>
    window.addEventListener('load', function() {
        try {
            var gaFields;
    
            function checkGaconnector() {
                return gaFields = gaconnector.getCookieValues(), !!gaFields.lc_source;
            }
            var interval = setInterval(function() {
                checkGaconnector() && (clearInterval(interval), updateZohoForm());
            }, 100);
    
            function updateZohoForm() {
                var URLparams = new URLSearchParams(gaFields).toString();
                var zohoIframe = document.querySelectorAll('iframe[src*="forms.zohopublic.com"]');
                if (zohoIframe === null) return;
                else if (zohoIframe.length === void 0) {
                    var separator = zohoIframe.src.indexOf('?') > -1 ? '&' : '?';
                    var newSrc = zohoIframe.src + separator + URLparams;
                    zohoIframe.src = newSrc;
                } else
                    for (var i = 0; i < zohoIframe.length; i++) { var separator = zohoIframe[i].src.indexOf('?') > -1 ? '&' : '?';
                        var newSrc = zohoIframe[i].src + separator + URLparams;
                        zohoIframe[i].src = newSrc;
                    }
            }
        } catch (e) {}
    });
    </script>
    Note: If you have custom domains set up in Zoho Forms, you’ll need to change the URL on line 15 to your own custom domain. Find line 15:
    var zohoIframe = document.querySelectorAll('iframe[src*="forms.zohopublic.com"]'); Change this to:
    var zohoIframe = document.querySelectorAll('iframe[src*="yourdomainhere.com"]');

Setting up the GA Connector fields on Zoho Forms

On your Zoho Forms builder, add a hidden field for each GA Connector field that you want to track. For a full list of available GA Connector fields, refer to the table at the end of this article.

  1. While on the Zoho form builder, drag a Single Line field to your form to add a field.
  2. Click on the new field that you’ve created and select Properties, and under the Visibility section, select Hide Field.
  3. After creating the hidden fields for each GA Connector field that you want to track, go to Settings > Field Alias.
  4. On the Field Alias page, select the hidden fields that you have just created and add its equivalent GA Connector Input ID as the alias. (Example: All Traffic Sources: all_traffic_sources)

API-Based integration

The API-based version doesn’t use hidden fields. Instead, Zoho Forms passes the submitted email address to GA Connector, which matches it with the visitor’s tracking data on our servers and syncs it to your CRM.

Step 1: Enable PostMessage tracking in Zoho Forms

  1. Open your form in Zoho Forms and click Edit.
  2. Go to Share > Google Tag Manager & Custom Tracking.
  3. Under PostMessage Tracking, enable Submit Form and select Configure Website Data Push.
  4. Find your form’s email field and map it to the Field Alias zf_email.
  5. Click Save.
  6. Repeat for all of your forms.
Use the same alias on every form.

The script below looks for the alias zf_email. If you use a different alias on a form, that submission won’t be identified.

Step 2: Replace your GA Connector script

Replace your current GA Connector script with the following, on all pages of your website:

HTML
<script src="https://track.gaconnector.com/gaconnector.js" type="text/javascript"></script>
<script type="text/javascript">gaconnector2.track('YOUR GA CONNECTOR ACCOUNT ID');</script>
<script>
/* --- Zoho Forms Integration --- */
var GAC_EMAIL_FIELD = 'zf_email';
window.addEventListener('message', function(event) {
    var frame = document.querySelector('iframe[src*="/formperma/"]');
    if (!frame || event.origin !== new URL(frame.src).origin) return;
    var payload = event.data && event.data.payload;
    if (!payload || payload.e !== 'zf_submitform') return;
    var email = payload.d && payload.d[GAC_EMAIL_FIELD];
    if (!email) return;
    if (typeof gaconnector2 === 'undefined') return;
    gaconnector2.identify('email', email);
});
</script>
Set your account ID.

Replace YOUR GA CONNECTOR ACCOUNT ID with your own GA Connector account ID. You can find it in your GA Connector account. If you haven’t received yours yet, please email [email protected].

Keep your existing tracking subdomain.

If your current script loads gaconnector.js from ta.gaconnector.com instead of track.gaconnector.com, keep the subdomain you’re already using and only add the third script block.

The GA Connector script must be placed on every page of your website, ideally in the <head> or at the very beginning of the <body> tag, so visitors are tracked from their first page view.

Checking that it works

  1. Open a page with your embedded Zoho form and submit a test entry with an email address you can recognize.
  2. In your browser’s developer tools, open the Network tab and confirm a request is sent to the GA Connector tracking domain on submit.
  3. Check the matching record in your CRM. API-based tracking data syncs with a 15–30 minute delay, so give it some time before checking.

Still stuck?

If submissions aren’t being identified, contact our support team and include the page where your form is embedded so we can take a look.


More than just UTM parameters

GA Connector adds UTM information, geolocation, referral information to your Zoho Forms 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. (The Input IDs below are the field aliases used by the Cookie-Based integration.)

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