Google Analytics: tracking account creation/registration help

New Member
3 0 1

Hi all,

 

Looking for some help on this! We're using Google Tag Manager to track some online engagements however I'm struggling to successfully track account registrations. I'm sure it's a simple case of adding tracking code to the below, just need to work out what code to add and where it needs to be added. Can anyone help?

 

<div class="page-width page-content">
<div class="grid">

<div class="grid__item medium-up--one-third medium-up--push-one-third">

<header class="section-header">
<h1 class="section-header__title">{{ 'customer.register.title' | t }}</h1>
</header>

<div class="form-vertical">
{% form 'create_customer' %}

{{ form.errors | default_errors }}

<label for="FirstName">{{ 'customer.register.first_name' | t }}</label>
<input type="text" name="customer[first_name]" id="FirstName" class="input-full" {% if form.first_name %}value="{{ form.first_name }}"{% endif %} autocapitalize="words" autofocus>

<label for="LastName">{{ 'customer.register.last_name' | t }}</label>
<input type="text" name="customer[last_name]" id="LastName" class="input-full" {% if form.last_name %}value="{{ form.last_name }}"{% endif %} autocapitalize="words">

<label for="Email">{{ 'customer.register.email' | t }}</label>
<input type="email" name="customer[email]" id="Email" class="input-full{% if form.errors contains 'email' %} error{% endif %}" {% if form.email %} value="{{ form.email }}"{% endif %} autocorrect="off" autocapitalize="off">

<label for="CreatePassword">{{ 'customer.register.password' | t }}</label>
<input type="password" name="customer[password]" id="CreatePassword" class="input-full{% if form.errors contains 'password' %} error{% endif %}">

<p>
<input type="submit" value="{{ 'customer.register.submit' | t }}" class="btn btn--full">
</p>

{% endform %}
</div>

</div>

</div>
</div>

 

Thanks in advance :)

Alex

0 Likes
Highlighted
Explorer
40 4 10

Hi Alex-

To track form submits using GTM, you don't need to change the code of the form, you add a trigger in GTM that will fire a GA tag based on the form submission. First, add a new Form Submission trigger to fire on Some Pages using Form ID contains create_customer

 

Then create a Google Analytics tag with Track Type of Event and fire this tag using the trigger you setup. If you have Recaptcha setup, you will need to add extra steps, but this should get you pushed in the right direction.

 

Hope that helps...

0 Likes
Highlighted
New Member
3 0 1

Hi @stevelam  - thank you! That was very quick and easy... I think my brain had given up after a long day. 

 

Best,


Alex

1 Like
Highlighted

Be careful to factor in when the form is submitted but doesn't validate or successfully submit. Otherwise, you'll send multiple events into GA.

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
0 Likes