Legacy : Implement Identify Calls with Google Tag Manager

Last Updated: January 12, 2024

🔍 Please note: this article is for customers on Standard Bundle, Enrichment, or Clearbit Platform plans.

Sending Identify calls helps Clearbit identify users, track those users' actions (like page views), and record traits about them. If your website uses forms that support Google Tag Manager’s built-in Form Listener, you may be able to implement Identify calls without adding custom JavaScript to your website.

Clearbit_Identify_Call.png

Skip Ahead to:

How it Works

Google Tag Manager has a built-in Form Submission trigger that can detect any time a form is submitted across your website and read data from the submission itself, assuming your forms use a standard form structure.

What if my forms don't use standard form inputs?

If your forms do not support standard form submit events, you can send Identify events via Google Tag Manager by passing an event with the form input data directly to the data layer.

In the example below, Google Tag Manager will detect the standard form inputs, trigger an event when the form is submitted, and send the Clearbit Identify call using the submitted email address.

In this example, we'll assume the below form (with a type="email" attribute/value) is present in the HTML page.

<form>
<input type="email" name="email" placeholder="email" />
<input type="submit" />
</form>

How to Set it Up

  1. Enable the form variables in the Variables tab of your Google Tag Manager container. This will allow you to tap into the different elements of the form in the Custom HTML tag that will be fired in step 3.
    Google_Tag-Manager_step1.gif
  2. Create a Form Submission trigger that triggers on "All Forms".

    Screenshot_2022-12-02_at_2.42.01_PM.png

  3. Create a new Custom HTML tag that uses DOM selectors to identify, extract, and reformat the form elements into an identify call.

    In this example, the code picks up the email that was submitted and sends it over to Clearbit via the identify call:
    <script>
     var email = {{Form Element}}.querySelector('input[type="email"]').value;
     clearbit.identify(email, {
       "email": email
     });
    </script>

    Screenshot_2022-12-02_at_2.57.14_PM.png

  4. Add the previously created Form Submission trigger as the trigger that will fire our Custom HTML tag.
    Screenshot_2022-12-02_at_3.48.47_PM.png
  5. That's it! Publish your changes and start identifying people visiting your website through the Clearbit platform.

 

Other Resources

For more detailed guides on using Google Tag Manager’s Form Submission triggers, please refer to Google’s documentation here or this helpful article from Analytics Mania or Simo Ahava.