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

Tracking URL Clicks in a survey

  • October 26, 2023
  • 3 replies
  • 226 views

XM_JoshB
Level 5 ●●●●●
Forum|alt.badge.img+31
  • Level 5 ●●●●●
  • 71 replies

 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.

3 replies

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+34
  • Level 8 ●●●●●●●●
  • 654 replies
  • Answer
  • October 29, 2023

We need to put the code here in addOnReady function.


XM_JoshB
Level 5 ●●●●●
Forum|alt.badge.img+31
  • Author
  • Level 5 ●●●●●
  • 71 replies
  • October 30, 2023

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


chackbusch
QPN Level 5 ●●●●●
Forum|alt.badge.img+22
  • QPN Level 5 ●●●●●
  • 415 replies
  • September 2, 2024

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.