Answers Click Tracking with Custom Frontend

We’re in the middle of implementing Answers directly using the API, meaning we’re not using pages to present the answers experience, we’re building the frontend ourselves.

As part of that, I’d like to get conversion and Answers click tracking installed and have as much of the Answers reporting working as possible. Conversion tracking is relatively easy–I think:

  • Identify relevant conversions.

  • Create the conversion event

  • Install the conversion tag via Google Tag Manager

Note that these conversion tracking tags transmit via a GET request. The URL looks something like the following.

https://realtimeanalytics.yext.com/conversiontracking/conversion?cid=xxxxxx-4fb0-4732-b91d-dc081b86789b&cv=&v=1653678496301

The latter–analytics click tracking–, I’m struggling with.

I can create a click tracking event in Analytics, but there isn’t any configuration file or JavaScript–yet–on our side to associate clicks with the rendered entities in our frontend. Additionally, creating a click-tracking event in the user interface doesn’t output a tracking tag to use in Google Tag Manager.

So when I look at the integration on yext.com–click here for an example query–and click on an entity, I see the network POST request in the network log in dev tools to the following URL with the following payload.

Request URL: https://answers.yext-pixel.com/realtimeanalytics/data/answers/919871

{
    "data": {
        "eventType": "CTA_CLICK",
        "verticalKey": "products",
        "searcher": "UNIVERSAL",
        "entityId": "answers",
        "experienceKey": "yextanswersconfig",
        "experienceVersion": "PRODUCTION",
        "visitor": {
            "id": "UA-24978808-1",
            "idMethod": "YEXT_ANSWERS_USER_ID"
        },
        "queryId": "018106de-baf7-600b-77d5-3a25ac14dac3"
    }
}

My question, is how can I create this tracking on our front end so I transmit clicks on Answers results back to Yext? I believe this will power both Analytics Answers reporting but I believe it also powers some algorithm decisions as well, correct?

Is there some JavaScript library that I can load or perhaps another Google Tag Manager template I could use to configure this answers click tracking? I’ve requested that my developer render the results in the DOM with data-attributes similar to what exist on Yext.com today–see below for an example.

<a class="HitchhikerCTA js-HitchhikerCTA" href="https://www.yext.com/customers/peoples-united-bank" data-eventtype="CTA_CLICK" data-eventoptions="{&quot;verticalKey&quot;:&quot;case_studies&quot;,&quot;searcher&quot;:&quot;UNIVERSAL&quot;,&quot;entityId&quot;:&quot;peoples-united-bank&quot;}" target="_top" data-is-analytics-attached="true">
    <div class="HitchhikerCTA-iconLabel"> Read Case Study </div>
</a>

How can I ensure that I transmit Analytics click data back to Yext from our custom frontend?

Hi @Zach_Shearer -

To utilize conversion tracking with an Answers experience built with the API, you can use the Analytics Library. This Answers guide walks through installing and importing the library as well as what is needed to fire an event whenever someone clicks on a search result.

The Answers Analytics Event Types unit is also a helpful resource when setting up the analytics request.

Let me know if this works or if you still run into issues after setting up the library!

Thanks for providing this, @Micaela_Luders ! I’ll take this back to my development team to see if we can get this incorporated into our implementation.

I know that Yext has the Answers conversion actions templates for Google Tag Manager. Any word of having the Answers click tracking added as a Google Tag Manager template?

I definitely have that Hitchhiker’s unit on my radar. Hopefully I can walk through that shortly.

Hey @Zach_Shearer, regarding Answers click tracking as a Google Tag Manager template - no plans for that at the moment but would be a great Ideas post!

@Micaela_Luders , thanks for providing help on this thread previously. It looks like the following article now yields a 404. I tried searching for it, but I can’t seem to find the replacement.

@Micaela_Luders, I found it. It’s located here: Introduction | Hitchhikers

1 Like