Manually tracking links
Premise
Some types of links cannot be tracked automatically by Contactsend. These links appear in light gray on the link summary page in Create > New Campaign.
However, they can be tracked manually to collect statistical data about clicks.
These links are typically dynamic, for example:
https://www.example.com/index.php?user_id=1&firstname=John&lastname=Smith
Goals
The correct syntax for manually tracking dynamic links.
Syntax
The syntax is:
%{LINK_DESCRIPTION[CATEGORY_ID]%%LINK_URL}%
where:
- LINK_DESCRIPTION is the name of the link displayed in the Contactlab statistics section;
- CATEGORY_ID is the numerical ID of the link category managed in Configure > Classifications > Link Categories. The default category, corresponding to No category selected, is
1; - LINK_URL is the static URL to track.
If the same manually tracked link is present in both the HTML version and the alternative text, make sure that the description and category ID are the same in both versions.
Differentiate the static part of the link from the dynamic part
To track a dynamic link, split it into two parts: a static part and a dynamic part containing variable values.
To ensure that the final link works, the static part must be a syntactically valid link.
For example, the following link contains the two dynamic parameters firstname and lastname:
https://www.example/a.asp?p=index&firstname=${firstname}$&lastname=${lastname}$
It can be split in different ways.
Example 1:
- Static part:
https://www.example.com/a.asp - Dynamic part:
p=index&firstname=${firstname}$&lastname=${lastname}$
Example 2:
- Static part:
https://www.example/a.asp?p=index - Dynamic part:
&firstname=${firstname}$&lastname=${lastname}$
The link cannot be split as follows:
- Static part:
https://www.example/a.asp?p= - Dynamic part:
index&firstname=${firstname}$&lastname=${lastname}$
In this case, the static part is not a valid link.
The static part can therefore be tracked as a normal static link, while the dynamic part is excluded from tracking.
The two parts of the link must always be separated by a question mark (?).
Example 1:
- Static part:
%{Description[1]%%https://www.example.com/a.asp}% - Dynamic part:
?p=index&firstname=${firstname}$&lastname=${lastname}$
The first character does not need to be replaced because it is already ?.
The complete link is:
%{Description[1]%%https://www.example.com/a.asp}%?p=index&firstname=${firstname}$&lastname=${lastname}$
Example 2:
- Static part:
%{Description[1]%%https://www.example.com/a.asp?p=index}% - Dynamic part:
&firstname=${firstname}$&lastname=${lastname}$
The first character & must be replaced with ?.
The complete link is:
%{Description[1]%%https://www.example.com/a.asp?p=index}%?firstname=${firstname}$&lastname=${lastname}$
Note
The manual tracking system is based on the fact that dynamic links cannot be tracked because they change for each user. Therefore, only the static parts of the links are tracked manually.
When these static parts are identical, as in the following example:
- A:
%{Summary[1]%%https://www.example.com/a.asp}%?p=index=${clientcode}$&article=${id}$ - B:
%{News[1]%%https://www.example.com/a.asp}%?p=index=${name}$&article=${data}$
the system considers links A and B to be the same link repeated several times.
One possible solution is to add an ID to the static part to distinguish it from the others:
- A:
%{Summary[1]%%http://www.example.com/a.asp?id=1}%?p=index=${clientcode}$&article=${id}$ - B:
%{News[1]%%http://www.example.com/a.asp?id=2}%?p=index=${name}$&article=${date}$
The system then recognizes the two links as different and distinguishes them in the statistics.