Tracking URL Clicks in a survey | Experience Community
Skip to main content
Solved

Tracking URL Clicks in a survey

  • Oct 26, 2023 5:38 PM UTC
  • 3 replies
  • 343 views

XM_JoshB
Level 5 ●●●●●
Forum|alt.badge.img+38

 I am looking to use tags to track URL clicks  and am not having much success with the code (it’s not generating metadata). I created a text/graphic field with the url and added Javascript 

 

<div><a href="https://jobs.baesystems.com/global/en/alumni " id="Link1" rel="noopener" target="_blank">Alumni Site</a> - Resources for BAE Sys Alumni</div>

jQuery('#Link1').click(function(event) { Qualtrics.SurveyEngine.setEmbeddedData("clicked1", "1")

 

I have been struggling where to put the code in Qualtrics to create the fields and then call them. Does anyone have guidance on where I should put these?

Best answer by Shashi

We need to put the code here in addOnReady function.

View original

3 replies

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • Answer
  • Oct 29, 2023 6:56 AM UTC

We need to put the code here in addOnReady function.


XM_JoshB
Level 5 ●●●●●
Forum|alt.badge.img+38
  • Author
  • Level 5 ●●●●●
  • Oct 30, 2023 11:54 AM UTC

@Shashi , thank you. This was exactly what I was looking for. 


chackbusch
QPN Level 5 ●●●●●
Forum|alt.badge.img+22
  • QPN Level 5 ●●●●●
  • Sep 2, 2024 7:03 AM UTC

I just described in some other topic in detail what to do to track if a link was clicked in case you are working with simple layout. Just wanted to link this here as well as the setup above is probably in regards to other layouts.