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.
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="{"verticalKey":"case_studies","searcher":"UNIVERSAL","entityId":"peoples-united-bank"}" 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?