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

Tracking URL Clicks in a survey


XM_JoshB
Level 4 ●●●●
Forum|alt.badge.img+22

 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

Shashi
Level 8 ●●●●●●●●
Forum|alt.badge.img+31
  • Level 8 ●●●●●●●●
  • October 29, 2023

We need to put the code here in addOnReady function.


XM_JoshB
Level 4 ●●●●
Forum|alt.badge.img+22
  • Level 4 ●●●●
  • October 30, 2023

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


chackbusch
QPN Level 5 ●●●●●
Forum|alt.badge.img+21
  • QPN Level 5 ●●●●●
  • 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. 


Leave a Reply