Switching Hardcoded URLs to use a Custom Field

Hi Team,

I’ve been working on building out a promotion vertical within my client’s Answers experience. This is a hidden vertical that just displays a pinned card for certain queries - I’ve attached a screenshot of said card below.

As you’ll see from the screenshot, I’ve added the App Store & Google Play icons onto the cards. There are three different promo cards that show based on query, but the icons and clickthrough URLs are hardcoded and thus consistent for all three. The copy above the CTAs is what varies between the cards.

The client would like to measure & compare clicks between these three cards. Even though the URLs are hardcoded will this be possible through Yext Analytics? Or should I add a couple of custom fields onto the promo entities, one to control the App Store URL & the other to control the Google Play URL - the client can then append tracking tags to the end of these?

If the latter approach is needed can you guide me through how I’d add that logic into my component.js & template.hbs files for the card please? I created a new div to handle the app CTAs so not sure if I just need to tweak that a little. Below is the code for the current div, thanks!

  {{#if card.appCta}}
    <div class="HitchhikerStandard-appCTA">   
  <div class="app-div"><a href="https://itunes.apple.com/gb/app/three/id393530266?mt=8" class="app appStoreLink" target="_blank" style="outline: 0px;">
  <img class="app-img-apple" src="https://assets.sitescdn.net/landingpages/modules/app_download/images/app-store.svg" alt="app store image"></a></div>
    <div class="app-div"><a href="https://play.google.com/store/apps/details?id=com.hutchison3g.planet3&referrer=utm_source%3Dthreecouk%26utm_campaign%3DThreeAppPromo" class="app google-play" target="_blank" style="outline: 0px;">
    <img class="app-img-google" src="https://assets.sitescdn.net/landingpages/modules/app_download/images/google-play.svg" alt="google play store image"></a></div>
  </div>