Personalized URL

Personalized URLs (pURLs) are links that are tailor-made for a specific purpose, generally for individual clients. They can serve multiple purposes, for instance:

  • Click Tracking: A unique ID in the link makes it possible to track the source of the click (for example, a link in an email campaign).
  • User Tracking: A user-specific ID reveals who clicked the link and at what time.
  • Landing Pages: Information in the link invokes a unique landing page with specific products or services.
  • Personalized User Pages: Using information from a database, a user is served a completely personalized web page with their name and information tailored to them, enhancing user response.

Typically, a pURL takes the recipient to a personalized landing page, for example to download an invoice or get access to specific products or services.

Prerequisites

Creating a personalized URL in a Connect template requires some planning, because you need to have a few things at hand when adding it to a template.

First of all, you need a Workflow process for the pURL to point to; in response, this process will create personalized content.
In order to invoke that process, the host in the pURL must be followed by the HTTP action of the HTTP Server Input task that starts the process. For example, if its action is MakePDF, you could trigger the process by adding /MakePDF to the address of the Workflow server.
The rest of this Workflow process depends on what the pURL is used for. If it should output a personalized landing page, for example, it would be a web process with some OL Connect tasks (see Web processes with OL Connect tasks).

Secondly, the pURL must contain the data that Workflow needs in order to create the personalized response (be it a web page or other file). For instance, creating a personalized page that shows a client's invoice may require the Invoice Number to be present in the pURL, which is then used by Workflow to retrieve the invoice data, generate the invoice in PDF or HTML format using a template, and then return it to the browser.
The data needs to be included in the URL. In this URL, for example: http://www.example.com/MakePDF?uuid=8c33eda8-72af-11e5-8bcf-feff819cdc9f, a unique ID is passed as parameter. Parameters end up as key-value pairs in the request XML file. In the Workflow process you may use a Set Job Infos and Variables task to assign a value from that XML to a variable (see Data Selections, in Workflow's Online Help).

Finally, you need another Workflow process to provide the pURL to the user, in an email, for example, or in a QR code. This process must add the necessary data to the pURL. That data should be available through the Data Model used in the template.

In Workflow, you may make use of the system variable %U to create unique strings.

Inserting a pURL

Assuming that the necessary data and Workflow processes are available, here's how you insert a personalized URL in a template.

  1. Open the template and find or enter the text that you want to turn into a link.
  2. Select the text, right-click it and select Wrap in Span....
  3. Give the span an ID, for example: get_pdf_link. Click OK.
    The text Download PDF, wrapped it in a span with the ID get_pdf_link, would look like this on the Source tab: <span id="get_pdf_link">Download Invoice</span>.
  4. With the span selected, click on 'ID' on the Attributes pane (click on the field name, not the field itself). This will insert a script that has this ID as selector, and open it in the script editor.
    Since it's dynamic, inserting a personalized URL always implies writing a script, however small and simple. For a basic explanation of scripts, see Writing your own scripts.
  5. Type the code that wraps the span in a <a> element (a hyperlink). In the link, the host should be followed by the action with which the corresponding Workflow process is triggered and the data with which Workflow will be able to create a personalized response.

Sample script

Let's assume:

  • A Workflow process is triggered by the HTTP action: MakePDF.
  • The template that outputs the pURL is to be merged with a record that contains a data field invoice_UUID. This data field holds the information that the 'MakePDF' Workflow process needs in order to create personalized output.
  • The template contains a span with the link text "Download Invoice": <span id="get_pdf_link">Download Invoice</span>.

The following script, with the selector #get_pdf_link, will create a valid link around the span:

results.before('<a href="http://www.example.com/MakePDF?uuid=' + record.fields.invoice_UUID + '">');
results.after('</a>');