Professional Documents
Culture Documents
Zuko Guides - Setting Up Zuko in Google Tag Manager
Zuko Guides - Setting Up Zuko in Google Tag Manager
Setting up Zuko
in Google Tag
Manager
Each time you set up a form in Zuko, you are given two pieces of code:
Activity Tracking Tag - this tracks all interaction with your form and fields, and
needs to be fired when a visitor views your form. This needs to be loaded only
after the form itself has loaded on the page
<script src="https://assets.zuko.io/js/v2/client.min.js"></script>
<script>Zuko.trackForm({target:document.body,slug:'77be08c53158706
3'}).trackEvent(Zuko.FORM_VIEW_EVENT);</script>
PLEASE NOTE THIS IS DUMMY CODE ONLY AND SHOULD NOT BE USED
IN YOUR TAGS. THE CODE YOU SHOULD USE IS PROVIDED IN THE
APP WHEN YOU SET UP THE FORM.
Completion Tracking Tag - this tracks successful completions of your form and
should be fired when you consider the form to be successfully submitted
<script src="https://assets.zuko.io/js/v2/client.min.js"></script>
<script>Zuko.trackForm({slug:'77be08c531587063'}).trackEvent(Zuko.
COMPLETION_EVENT)</script>
PLEASE NOTE THIS IS DUMMY CODE ONLY AND SHOULD NOT BE USED
IN YOUR TAGS. THE CODE YOU SHOULD USE IS PROVIDED IN THE
APP WHEN YOU SET UP THE FORM.
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 1/11
05/01/2023, 13:08 Zuko Guides | Setting up Zuko in Google Tag Manager
Each pair of codes contains a unique slug, so you cannot simply fire the tracking
code on all pages - you need to be a bit more targeted.
Rename the Tag to reflect that it is the Zuko activity tag then open up Tag
configuration:
You’ll want to select Custom HTML tag from the list of options:
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 2/11
05/01/2023, 13:08 Zuko Guides | Setting up Zuko in Google Tag Manager
From here, you should have Zuko open in a different tab. After you’ve added a
form, Zuko will give you the two pieces of code you need. Copy the tracking
code:
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 3/11
05/01/2023, 13:08 Zuko Guides | Setting up Zuko in Google Tag Manager
If you already have a trigger set up to fire for your form you may be able to use
that but we usually advise setting up a new one for Zuko.
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 4/11
05/01/2023, 13:08 Zuko Guides | Setting up Zuko in Google Tag Manager
Which one you choose will depend on how your form is built and works on your
website. Here are some options:
Pageview - fires a code as soon as the page is viewable by a visitor. Whilst this
may work for most forms, sometimes this causes the Zuko code to load before
the form is presenting the page. This will mean that Zuko can’t see the form
when loaded and will not continue to send across events
Window Loaded - this is a good option. This waits until the window loaded
event is sent to GTM, usually after everything on the page has been loaded and
is ready to interact with. This option overcomes the issue with the pageview
event above.
Clicks - if your form is for example contained in a modal that is only visible after
clicking on a button on a page, you may want to only fire the Zuko code when a
visitor on the button itself.
Timer - if the window loaded event still does not work and your page takes a
while to load (a few seconds for example) - you can set a timer to fire Zuko after
a set period of time to ensure when it does your form is loaded. You will need to
make sure Zuko is only fired once per page.
Once you’ve selected Page View - Window Loaded, you will then also need to
select Some Window Loaded Events and define some conditions.
For some forms, you will be able to copy and paste a static URL, like so:
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 5/11
05/01/2023, 13:08 Zuko Guides | Setting up Zuko in Google Tag Manager
1. https://example.com/checkout/step1/customerID-XXXXXXXX
2. https://example.com/checkout/step1?
customerid=XXXXX&products=coolstuff
3. https://example.com/checkout/customerID-XXXXXXXX/step1
In these cases you can use another matching rule offered by GTM:
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 6/11
05/01/2023, 13:08 Zuko Guides | Setting up Zuko in Google Tag Manager
Important note - when adding your form into Zuko, you will have entered a
URL when setting it up. Don’t worry if this URL does not reflect everywhere the
form appears - you can fire the Zuko code on multiple URLs even if some of
them are different to the one you have configured in Zuko. When data arrives at
the Zuko servers, it looks for your domain and the slug, so as long as those two
match your previously added form, data will be collected and shown.
In the same way you did for the activity tracking code, add the completion tag
as a custom HTML snippet:
For many forms, when a visitor submits the form they will be taken to a new
URL:
https://www.example.com/checkout/orderconfirmed
https://www.example.com/checkout/orderconfirmed?orderid=98765698987
https://www.example.com/checkout/thankyou
https://www.example.com/enquiryreceived
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 7/11
05/01/2023, 13:08 Zuko Guides | Setting up Zuko in Google Tag Manager
In this instance, you can set up a trigger to fire when this page is viewed by a
customer:
Note - for the completion tag, you can use pageview as the completion code
can fire as soon as the page is viewable - it does not have to wait for any content
to be loaded.
You can apply the same principles mentioned above to fire on each step.
We advise against using a click event on the submit button - since it will be
possible for a visitor to try and submit the form by clicking this and failing (if
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 8/11
05/01/2023, 13:08 Zuko Guides | Setting up Zuko in Google Tag Manager
they have validation errors for example). You will therefore get false positives
where it seems like visitors have submitted the form but have not.
Or a custom event:
It is really up to you how you choose to fire the completion code as long as you
are doing so to reflect when the form has been successfully submitted.
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 9/11
05/01/2023, 13:08 Zuko Guides | Setting up Zuko in Google Tag Manager
the completion code at the very end of the journey when the entire form is
submitted (not between each step).
You can then change your trigger to fire on Window Loaded, then set a
matching rule based on the random number. For example you could set a rule
where if the number ends with a one, Zuko fires:
This would fire for 10% of traffic. You can also use regex matching to change the
matching rules and fire on different proportions of traffic.
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 10/11
05/01/2023, 13:08 Zuko Guides | Setting up Zuko in Google Tag Manager
You can check your setup either by using Preview Mode in Google Tag manager
and completing your own form.
You can also follow our guide using the network tab here -
https://www.zuko.io/guides/checking-your-code-installation
It may be worth trying a few different approaches to adding the tracking and
completion codes if you are struggling, using preview mode each time to check
your set up.
https://www.zuko.io/guides/setting-up-zuko-in-google-tag-manager 11/11