Tags and Filters
When sending a campaign, you are able to use a number of custom tags and filters.
Some of the most common tags are found below:
Tag | Required |
[UNSUBSCRIBE_URL] | YES |
[COMPANY_FULL_ADDRESS] | YES |
[UPDATE_PROFILE_URL] | NO |
[WEB_VERSION_URL] | NO |
[CAMPAIGN_URL] | NO |
[LIST_NAME] | NO |
[LIST_SUBJECT] | NO |
[LIST_DESCRIPTION] | NO |
[LIST_FROM_NAME] | NO |
[CURRENT_YEAR] | NO |
[CURRENT_MONTH] | NO |
[CURRENT_DAY] | NO |
[CURRENT_DATE] | NO |
[COMPANY_NAME] | NO |
[COMPANY_ADDRESS_1] | NO |
[COMPANY_ADDRESS_2] | NO |
[COMPANY_CITY] | NO |
[COMPANY_ZONE] | NO |
[COMPANY_ZIP] | NO |
[COMPANY_COUNTRY] | NO |
[COMPANY_PHONE] | NO |
[CAMPAIGN_SUBJECT] | NO |
[CAMPAIGN_TO_NAME] | NO |
[CAMPAIGN_FROM_NAME] | NO |
[CAMPAIGN_REPLY_TO] | NO |
[CAMPAIGN_UID] | NO |
[SUBSCRIBER_UID] | NO |
[EMAIL] | NO |
[FNAME] | NO |
[LNAME] | NO |
In addition, each of the above tags receive a set of “filters.” Filters are a simple way of transforming the tag in some way or another. For example, you might want to embed a link to Twitter in your campaign URL itself.
Using only tags, you would embed it like:
https://twitter.com/intent/tweet?text=[CAMPAIGN_SUBJECT]&url=[CAMPAIGN_URL]
But there is a problem, because Twitter expects arguments to be URL encoded:
https://twitter.com/intent/tweet?text=my%20super%20campaign&url=http%3A%2F%2Fwww.domain.com%2Fcampaigns%2F1cart129djat3
But instead it will get https://twitter.com/intent/tweet?text=my super campaign&url=http://www.domain.com/campaigns/1cart129djat3
…which includes spaces and isn’t “correct” in URL-land. In order to overcome this issue, you need to apply filters over the tags. Therefore the URL becomes:
https://twitter.com/intent/tweet?text=[CAMPAIGN_SUBJECT:filter:urlencode]&url=[CAMPAIGN_URL:filter:urlencode]
…using the urlencode filter (you simply place the word “filter” after a colon, followed by another colon and the filter you’d like to use).
Let’s say we want to make sure our Twitter text starts with a capitalized letter and the rest of the letters are lowercase.
In order to accomplish this, you would apply multiple filters (separated by a pipe character) to the same tag, for example:
https://twitter.com/intent/tweet?text=[CAMPAIGN_SUBJECT:filter:lowercase|ucfirst|urlencode]&url=[CAMPAIGN_URL:filter:urlencode]
(Please note, the order in which you add the filters is the same order in which they are applied)
Here is the entire list of filters:
urlencode | will urlencode your tag |
rawurlencode | will rawurlencode your URL |
htmlencode | will convert HTML tags into their correct entities |
trim | will trim the white space from the beginning and end of your tag |
uppercase | will transform your entire tag to uppercase |
lowercase | will transform your entire tag to lowercase |
ucwords | will capitalize the first letter of the words in your tag’s content |
ucfirst | will capitalize only the first letter of your tag’s content |
reverse | will reverse your tag content |