Skip to main content

Manually tracking links

Premise

Some types of links cannot be automatically tracked by Contactsend (they appear in light gray on the link summary page in Create > New Campaign). However, it is possible to track them "manually" so that you can still collect statistical data related to clicks.

These links are typically dynamic ones, for example:

https://www.example.com/index.php?user_id=1&firstname=John&lastname=Smith

Goals

Know how to apply the correct syntax in order to manually track dynamic links.

Syntax

The syntax to use is:

%{LINK_DESCRIPTION[CATEGORY_ID]%%LINK_URL}%

where:

  • LINK_DESCRIPTION is the name of the link that will be displayed in the Contactlab statistics section.
  • LINK_CATEGORY_NUMBER is the numerical ID of the link category managed in the Configure > Classifications > Link Categories section of ContactLab. The default category (corresponding to “No category selected”) is 1.
  • URL_OF_LINK is the static url to track.
warning

If the same manually tracked link is present both in the HTML version an the alternate text, pay attention description and category id are the same in both versions.

To track a dynamic link you must “split” it into two parts, a static one and a dynamic one (i.e.: containing variable values).

To be sure that the final link works, its static part must be a syntactically valid link to all effects and purposes.

With a link such as:
https://www.example/a.asp?p=index&firstname=${firstname}$&lastname=${lastname}$

which evidently contains the two dynamic parameters, firstname and lastname, we can split it in various different ways.

Example 1:

  • Static part: https://www.example.com/a.asp
  • Dynamic part: p=index&firstname=${firstname}$&lastname=${lastname}$

or

Example 2:

  • Static part: https://www.example/a.asp?p=index
  • Dynamic part: &firstname=${firstname}$&lastname=${lastname}$

but NOT in:

  • Static part: https://www.example/a.asp?p=
  • Dynamic part: index&firstname=${firstname}$&lastname=${lastname}$

as in the latter case the static part does not satisfy the rule of having a valid link.

We can consequently track the static part as a normal static link (see “Syntax” above), while leaving the dynamic part out of tracking.

The rule requires that the two parts of the link determined in this way must always be separated by ? (question mark).

Example 1:

  • Static part: %{Description[1]%%https://www.example.com/a.asp}%
  • Dynamic part: ?p=index&firstname=${firstname}$&lastname=${lastname}$
warning

It is not necessary to replace the first character as 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}$
warning

It is necessary to replace the first character & 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 – as the dynamic links cannot be tracked because they change for each user – the static parts of the links must be manually tracked.

As long as these static parts are identical, as in the 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}$

in this case, the system considers link A and link B as the same link repeated several times.

One possible solution is to add an ID to the static part in order to tell it apart 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}$ so that the system recognizes the two links as being different and therefore tells them apart in statistics.