Using Query Strings to add piped text | XM Community
Skip to main content
Solved

Using Query Strings to add piped text


MargaretW
Level 2 ●●
Forum|alt.badge.img+4

Is it possible to use a Query String and piped text to add text to a survey distributed by anonymous link based on the query string?

We have a programs registration form that will be linked to on about 30 different web pages. 

We know how to use query strings as embedded data to track which program folks are registering for.

However, we would like the name of the program they are registering for to appear in the survey text, possibly in the intro block.

For example, if the user clicks on https://www.awesomeprogram.fakedomain, we would like the text “Awesome Program” to appear on the survey.

This would allow us to have a single registration form for all of these programs.

We’re open to some code, if possible.

Thanks.

 

 

Best answer by TomG

MargaretW wrote:

Thanks for the reply. I got how the query string will work with an anonymous link and how we can then track that in the survey data.  Can we pass the “Awesome Program” into the survey itself, through branch logic maybe?

If ‘page’ is your url parameter, then you can pipe ${e://Field/page} and it will display the value of page (e.g., ‘Awesome Program’). You can also use the embedded data field  ‘page’ in survey logic.

By the way, you should url encode the parameter values. For example, page=Awesome+Program or page=Awesome%20Program.

View original

5 replies

PeeyushBansal
Level 6 ●●●●●●
Forum|alt.badge.img+39
  • Level 6 ●●●●●●
  • 1143 replies
  • March 6, 2025

You can append anonymous link with query string so link will be like:-

 

anaonymouslink?page=Awesome Program


PeeyushBansal
Level 6 ●●●●●●
Forum|alt.badge.img+39
  • Level 6 ●●●●●●
  • 1143 replies
  • March 6, 2025

So on 30 webpages you can have anonymous link appended with corresponding page string and create “Page” as embedded field to see this data with survey responses.


MargaretW
Level 2 ●●
Forum|alt.badge.img+4
  • Author
  • Level 2 ●●
  • 8 replies
  • March 6, 2025

Thanks for the reply. I got how the query string will work with an anonymous link and how we can then track that in the survey data.  Can we pass the “Awesome Program” into the survey itself, through branch logic maybe?


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5911 replies
  • Answer
  • March 6, 2025
MargaretW wrote:

Thanks for the reply. I got how the query string will work with an anonymous link and how we can then track that in the survey data.  Can we pass the “Awesome Program” into the survey itself, through branch logic maybe?

If ‘page’ is your url parameter, then you can pipe ${e://Field/page} and it will display the value of page (e.g., ‘Awesome Program’). You can also use the embedded data field  ‘page’ in survey logic.

By the way, you should url encode the parameter values. For example, page=Awesome+Program or page=Awesome%20Program.


MargaretW
Level 2 ●●
Forum|alt.badge.img+4
  • Author
  • Level 2 ●●
  • 8 replies
  • March 7, 2025

Got it! Thank you. Simpler than I thought I guess, but I did not consider the URL encode bit.


Leave a Reply