Passing arguments to URL Shortcuts

Options

It is possible to pass arguments to URL Shortcuts by simply changing the way they are linked to from http://www.foo.org/shortcutname to http://www.foo.org/site/RedirectHandler?key=shortcutname. This is very useful for doing server-side redirects based on some defined logic rather than relying on Javascript, i.e. if you want a dropdown list where users choose a specific page/section to view.

Here's an example to try ...

Create a page called shortcut_form and insert the following in the HTML content (where foo.org is your Convio site's domain name):



<form action="http://www.foo.org/site/RedirectHandler?key=formpost" method="post">
]x::<p style="color: #ff0000;">Error: Please select a page to go to.</p>::]]
<p><label for="s_pageToGoTo">Page To Go To:</label><br />
<select name="s_pageToGoTo" id="s_pageToGoTo">
<option value="0" selected="selected"> </option>
<option value="1">Page 1</option>
<option value="2">Page 2</option>
</select>
<input type="submit" id="pageToGoToSubmit" value="Go" /></p>
</form>

Then, create a URL Shortcut named formpost and insert this in the "Link to go to" field (note the line breaks are only used here for display and should be ommitted):



]x::http://www.foo.org/site/PageServer?pagename=shortcut_page1::
]x::http://www.foo.org/site/PageServer?pagename=shortcut_page2::
http://www.foo.org/site/PageServer?pagename=shortcut_form&error=pageToGoTo]]]]

View http://www.foo.org/site/PageServer?pagename=shortcut_form on the front-end. If you select 1 you will be taken to page 1 as defined in the URL Shortcut conditional, if you select 2 you'll be taken to page 2, etc. The final condition is used for error handling, so that in the case that the user does not indicate a response, they are taken back to the form and an error is displayed.

Note that the form does not need to be on a Convio-powered page to work (though of course the conditional statement for error-handling would have to be done differently on an external site), and the target URLs in the shortcut do not need to be Convio-powered pages.

Tagged:

Comments

  • Noah,

    Is it possible to use some of the logic above to auto-insert the correct source/sub-source code in a transaction from a unique URL?

    Hence:

    www.foo.org/test01 ==> donation form FOO ==> transaction report for donation form FOO shows gift from the shortcut URL to be src=test01

    www.foo.org/test02 ==> donation form FOO ==> transaction report  for donation form FOO shows gift from the shortcut URL to be src=test02

    www.foo.org/test03 ==> donation form FOO ==> transaction report  for donation form FOO shows gift from the shortcut URL to be src=test03

    Currently, there exists a scenario like this on my website, which I did not create:

    www.aicr.org/mem

    goes to Donations Classic form:

    https://secure2.convio.net/aicr/site/Donation?ACTION=SHOW_DONATION_OPTIONS&CAMPAIGN_ID=2821

    using a link shortcut: http://www.aicr.org/site/R?i=X_K7qfcI4yokRw2Lb-52SA

    causing the source code to show up in a transaction report as:

    SOURCE_TYPE = E-mail

    SOURCE_CODE = URL Tracking - www.aicr.org/memory

    I never set this up, but I think a Convio consultant, or Convio engineer may have.  I just don't know how to generate those nice obfuscated URLs which then render the information I want in my Transaction Reports.

  • http://www.aicr.org/site/R?i=X_K7qfcI4yokRw2Lb-52SA is a link automatically generated by Convio's Email tool, it is not a URL Shortcut. Convio converts links inserted in Emails to links of this format in order to track click-throughs and conversions, using a specific source and sub-source code as you described. You should not be using this link (or any others with "/site/R?") on your Web site, but instead should create a URL Shortcut pointing to the donation form. Then, in the Shortcut, you can specify your own source and sub-source.

  • Thanks, Noah. Someone had set it up that way, and it looked like some sort of "insider" trick.  Anyway, I'll solve the problem your way.

Categories