URL Regex -- help debugging | XM Community
Skip to main content
Question

URL Regex -- help debugging

  • July 7, 2022
  • 3 replies
  • 89 views

Forum|alt.badge.img+2

I have a site intercept running on a web app that is a directory of contacts. Each page in the directory has its URL formatted like so:
mysite.com/contact-directory/contact-profile.firstname_lastname.uniqueid.html
Example: mysite.com/contact-directory/contact-profile.grace_hopper.5c092b3b86fa9c7fa5e72a84ee4adc47.html
I have configured an embedded data parameter in the site intercept using the following URL regex to capture the firstname_lastname portion:
(?<=contact-profile\\.)[A-z_]+
But for some reason the matching embedded data field in the survey is completely unpopulated -- the site intercept isn't "throwing" anything for the survey to "catch."
What am I missing?

3 replies

Mishraji
Level 4 ●●●●
Forum|alt.badge.img+18
  • Level 4 ●●●●
  • July 9, 2022

KevinTroy - While I can't help much with Regex, Javascript can come in handy here too. You can capture the current page URL and pass it as embedded data to the survey. Then use the following JS code to get the full name.
image.png


Forum|alt.badge.img+2
  • Author
  • July 11, 2022

Thanks, Mishraji. We're going to be bringing the data into Qualtrics XM (fka Clarabridge) daily, so I'm looking for a way to extract the info automatically into an embedded data parameter, without any manual processing steps.


Mishraji
Level 4 ●●●●
Forum|alt.badge.img+18
  • Level 4 ●●●●
  • July 11, 2022

KevinTroy - The JavaScript solution would also do this automatically for you. Unfortunately, I don't have much clarity into Clarabridge/XM Discover.
All the best! :)