Link Object
On this page:
Standardised
The standard link. will put a link within your email to the specified place and allow any actions to take place.
You change the link text by including it in brackets after the API call, as shown below.
URL Variant
To have control over your link you can use the _url variant, which will allow you to add styling/images etc. to it.
This variant requires the <a ref</a> HTML.
link.unsub
Directs a user to the Unsubscribe landing page assigned to the link.
[* link.unsub *]
OR
[* link.unsub('Unsubscribe Here') *]
link.unsub_url
<a href="[* link.unsub_url *]">Unsubscribe Here</a>
link.webversion
The Web Version link directs a user to their default browser to view the campaign there.
[* link.webversion *]
OR
[* link.webversion('View this in your browser') *]
link.webversion_url
<a href="[* link.webversion_url *]">View the Web Version</a>
link.text_version
This will direct the recipient to the text only version of your campaign:
[* link.text_version *]
OR
[* link.text_version('See the text only version') *]
link.textversion_url
<a href="[* link.textversion_url *]">View the Text Version here</a>
link.prefill
If you are using a bespoke form you can link to this with link.prefill and the form's ID number.
[* link.prefill(1,'Go to the Bespoke Form here') *]
link.prefill_url
Or you can use link.prefill_url to output the url as the form link.
[* link.prefill_url(1) *]
Advanced Links
Track Personalised URL
If you want to track a personalised link you will need to store the personalisation within a Core or Data table. You can then use an $AMF_FIELD_tablefield$ replacer to add onto your link, which will allow you to draw in personalised data for each contact whilst only reporting on that one link.
It would look something like this:
<a href="http://www.adestra.com/?s=$AMF_FIELD_id.interests$">Discover more here</a>
# This will search the Adestra website (?s=) using the 'interests' field in a data table.
(The example shows the use of a Data Table field, denoted by the use of _id.field; if you wished to use data from your Core Table you would just put the table field (e.g. $AMF_FIELD_email$))
You can also use link.track_url. This is commonly used with remote XML, this is because it allows the link from the populated XML content to track clicks and show in the reporting.
The syntax requires the link and label for it to be parsed correctly, shown as such:
<a href="[*link.track_url(some.link, some.label) *]">[* some.label *]</a>
In context it would be used like this:
[* FOREACH section IN sections *] [* url = section.find('link') *] <a href="[*link.track_url(url)*]">Here's the Link!</a>[* END *]
Note: Be careful when using tracking links.
There are two common scenarios which will cause problems.
- When populating your Core or Data table you may be tempted to provide the full URL, including personalisation, so that you can use:
<a href="[* data('table_field') *]"> Click Here!</a>
This will not track anything, as using is unsuitable for link tracking.
- You may also be tempted to include link.track_url, such as:
<a href="[* link.track_url(data('table_field')) *]"> Click Here!</a>
Although this will track a link it also creates a separate link for each contact it sends to. This means that your report will be populated with as many tracked links as there are contacts in your list.
For more information on $AMF replacers, see to the Personalisation in URLs topic.
Share URL
You can also add a 'Share' link to your campaign using:
<a href="[* link.share_url(network_id, 'query=%24AMF_SHORT_PERMALINK%24') *]">Share to Network</a>
This will enable your content to be shared onto one of the following networks.
Network | network_id | query |
---|---|---|
1 | 'status=%24AMF_SHORT_PERMALINK%24' | |
2 | 'u=%24AMF_SHORT_PERMALINK%24' | |
3 | 'mini=true&url=%24AMF_SHORT_PERMALINK%24' | |
Digg | 4 | 'url=%24AMF_SHORT_PERMALINK%24' |
Delicious | 5 | 'url=%24AMF_SHORT_PERMALINK%24' |
StumbleUpon | 6 | 'url=%24AMF_SHORT_PERMALINK%24' |
7 | 'url=%24AMF_SHORT_PERMALINK%24' | |
Facebook Like | 8 | 'url=%24AMF_SHORT_PERMALINK%24' |
Google+ | 9 | 'url=%24AMF_SHORT_PERMALINK%24' |
10 | 'url=%24AMF_SHORT_PERMALINK%24' |
Sharing to Twitter would be as follows:
<a href="[* link.share_url(1, 'status=%24AMF_SHORT_PERMALINK%24') *]">Share to Twitter</a>