Google Tag Manager - Yext Conversion Template - Not Tracking As Expected

I’m working on implementing conversion tracking for a custom front-end Answers implementation. I’ve created custom conversions in two categories:

  • For custom conversion events on our website, e.g. form fill, key pageviews, etc.
  • For Answers vertical click tracking–I’m doing this as a stopgap until I can incorporate full Answers click tracking.

I’m following the steps in this article.

I’ve installed the custom template and created the associated tags. I’ve configured the corresponding triggers and am testing in Google Tag Manager preview mode. The tag is firing as expected, but not the corresponding network request to the following URL.

I should say, that network request isn’t happening when I use the custom template. If I choose to use a “Custom HTML” tag and use the code provided (See example below) in the “conversion setup” screen in Yext admin, the corresponding network requests occur as expected.

	window.ytagQ = window.ytagQ || [];
	function ytag() {window.ytagQ.push(arguments);}
	ytag('conversion', {'cid': 'xxxxxxxx});
<script async src=""></script>

Even more strange, any conversion event that is configured using the template does have the corresponding event sent to the ytagQ queue–see below for an example–but it doesn’t appear that the script is injected after the fact to process the network request, so it just sits in the queue.

Example Queue with Event Pending

        "0": "conversion",
        "1": {
            "cid": "xxxxxx",
            "cv": ""

Code from Current Yext Template
I’ve bolded the line that I believe is not functioning as expected.

const injectScript = require('injectScript');
const createArgumentsQueue = require('createArgumentsQueue');
const url = '';
const ytag = createArgumentsQueue('ytag', 'ytagQ');
ytag('conversion',  {'cid': data.cid, 'cv':});
**injectScript(url, data.gtmOnSuccess, data.gtmOnFailure, url);**

My Questions:

  1. Is this expected behavior?
  2. Are the network requests associated with the events configured with the Google Tag Manager template sent with beacon?
  3. Is there a better way to test this?
  4. Should I simply use the “Custom HTML” tag type to configure these conversion events?

@Zach_Shearer Hey thanks for your question!

I’m going to need a little more information to figure this out:

  1. Have you added the code for your GTM account to the <head> and <body> tags where you want your conversions fired?
  2. If so, what type of trigger are you using to trigger your Conversion Action?

When I set up my Conversion Action as shown below I’m seeing the tag fire so I don’t think it’s an issue with the template or Google Tag Manager but it could be possibly be an issue with your setup.


Example Code

<html lang="en">
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Static Template</title>

    <!-- Google Tag Manager -->
      (function (w, d, s, l, i) {
        w[l] = w[l] || [];
        w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
        var f = d.getElementsByTagName(s)[0],
          j = d.createElement(s),
          dl = l != "dataLayer" ? "&l=" + l : "";
        j.async = true;
        j.src = "" + i + dl;
        f.parentNode.insertBefore(j, f);
      })(window, document, "script", "dataLayer", "{REPLACE_WITH_GTM_ID}");
    <!-- End Google Tag Manager -->
    <!-- Google Tag Manager (noscript) -->
        style="display: none; visibility: hidden;"
    <!-- End Google Tag Manager (noscript) -->
      This is a static template, there is no bundler or bundling involved!

Thanks for the reply, Michael. Yep, the Google Tag Manager script is in place and serving a number of different tags without issue.

Interesting. I’ve tried this in another Google Tag Manager container for another site and it is working as expected. I might have to do some additional testing with the first site.

For the site in question, I’d actually changed all of my tag types to use the “custom html” tag type instead of the tag template and just used the snippet provided in “conversion setup”. I can try reverting them back. Do you see any issue with me deploying the conversion events using the script–see below–instead of the tag template?

	window.ytagQ = window.ytagQ || [];
	function ytag() {window.ytagQ.push(arguments);}
	ytag('conversion', {'cid': 'xxxxxxxxxx'});
<script async src=""></script>

@Zach_Shearer Hmm yeah that is interesting - not sure why that would be based on the testing I’ve done myself.

As far as using Custom HTML versus the Template, there should be no issues deploying the code this way. Typically customers who use Google Tag Manager want to use as little code as possible so the template is the most common implementation but using Custom HTML will also work as you’ve seen.

Let me know if you have any other questions!


1 Like

@Michael_Peralta I’ve just been informed by customer service that this is not possible if we’re not using the “Pages”. We are integrating using the API.

I will be able to map Search (formerly Answers) clicks to conversion events now that we have Search click tracking configured, but it doesn’t seem that it will be possible to map deeper conversions, e.g., file download, form fill, etc. to conversions events at this time.

Just commenting for posterity for others who might come across this topic.