Going to Different Parts of the Program or to Other Websites🔗
Going to Different Parts of the Program🔗
Sometimes, we may want the user to go immediately to other parts of the program, for example, depending on how they answer a given question. This can be done using the *goto and *label keywords. Note that *label is different than *tags, as *label acts as a "road marker" or a flagged point at which to land, whereas *tags "categorizes" something to recall later, similar to the "hashtag" (#) in many social media platforms. Take a look below.
*label: woodchuckQuestion*question: How much wood can a woodchuck chuck?*question: Do you want to reconsider that answer? Yes *goto: woodchuckQuestion No Fine then, moving on...
In this example, users who select "Yes" in the second question jump immediately to the label, and will once again see the woodchuck question. Users who select "No" will see the text "Fine then, moving on..." To make this happen, a *label was placed above the woodchuck question. The purpose of a *label is to specify a particular point in the program. A label's name can have any combination of letters and/or numbers (though it cannot have spaces or special characters). Here, the *label was given the name "woodchuckQuestion". Once a user selects the "Yes" option, they reach the line with the *goto keyword, which commands the program to go to the particular label that is specified. In this case, the *goto keyword said "woodchuckQuestion," sending the user immediately to the point in the program that has the label with that name.
Note: You can also give users a link to your program that starts them immediately at a *label of your choosing (instead of the very beginning). To learn how to do that, click here.
Going Immediately to Other Websites🔗
You can use *goto to automatically send your users away from your program and onward to a new website.
Why would you want to do this?
- To send study participants to the survey completion link to make sure they get compensated.
- To ingest data and integrate with an external tool.
- To send your users to other GuidedTrack programs (i.e. other run links).
To redirect to a URL, just provide it as the target of *goto:
We're done here, redirecting you elsewhere...*goto: https://www.guidedtrack.com
When we hit *goto above, it will pause to make sure all the data for
the user is saved, then redirect them to the URL provided in the same tab.
In cases when you're redirecting and not expecting the user to be back (such as when you're redirecting them to a survey completion link from your panel provider), you'll want to also mark their run as finished, so that your completion stats on the data page are calculated correctly.
To mark the run as finished before redirecting, add the *finish
attribute to *goto:
Redirecting you to the survey completion link:*goto: https://panel.example.com/abc123/complete *finish
Next: Headers
GuidedTrack Docs