NATS4 LinkCodes

From TMM Wiki
(Redirected from Linkcode)
Jump to navigationJump to search
For Affiliates
Affiliate Adtools
Automatic Campaigns
Affiliate Payment Information
Affiliate Defaults
Affiliate Stats Dumps
ASP Query String
Deep Linking
Main Program Page
Members Admin
The Members Admin
View Member Details
Add Member
MySQL Auth
Mod Authn DB
Multisite Access
Member Logging
Member Password Retrieval
OpenID Connect
Mod Auth OpenIDC
ID Numbers

A linkcode is a referral URL tracked by NATS. Linkcodes are how affiliates get credit for the traffic they redirect through NATS. To get an affiliate link code, click the Linkcodes link under "Affiliate Quick Links."

There are three types of link codes that NATS will recognize:

  • Encoded Links
  • Un-Encoded Links
  • Shortname Links


Encoded Link Codes

Figure 1.1 - Link Codes Explained

Encoded link codes are the most common variety of link code seen in NATS. All of the information required by NATS to tie an affiliate to a surfer is located in the string of characters at the end, which are base64-encoded.

Unencoded Link Codes

Figure 1.2 - Unencoded Link Codes Explained

Un-encoded link codes display a period-delimited list of all information that would be in an encoded string within your URL. This is an alternate way to display affiliate link codes; the following example will break down what is displayed in an un-encoded link code.

  • Link Domain – This is often the third level domain of the tour site that is actually a server alias to your NATS install. It is necessary for proper cookie tracking and surfer appeal.
  • Affiliate Username - The username of the affiliate who referred this surfer.
  • Track – The alias to the NATS tracking script you are using. Variations include track, ttrack, strack, qtrack, and gallery.
  • Programid - The numeric ID of the program that the surfer's transaction will be paid out under (See Things to Remember)
  • Siteid - The numeric ID of the NATS site your surfer is trying to visit.
  • Tourid - The numeric ID of the site's tour that your surfer will be redirected to (See Sites Admin for details)
  • Affiliate Campaignid - The numeric id of the campaign associated with the affiliate (0 = the default campaign for that affiliate)
  • Adtoolid - If the surfer followed a link code associated with an adtool, this will represent the numeric id of the adtool the surfer saw. If no adtool was used, this will default to 0.
  • Subid1 - This is used for extra tracking needed by some special adtool types, such as gallery builder.
  • Subid2 - This is available for custom use.

Shortname Link Codes

Shortname link codes look very similar to un-encoded link codes, with a crucial difference. Instead of using ID number like an un-encoded link codes, this format uses the shortnames of the program, site, and tour you have specified in the URL.


Decoding Link Codes

Encoded link codes can be decoded using base64 decoding, which uses ASCII characters and binary to encode/decode links. For the admins, we built a page that allows for creating/decoding NATS code. The URL should be http://<NATS_URL>.com/admin_codes.php. The affiliates also have a page that is not shown by default. The URL should be http://<NATS_URL>.com/internal.php?page=code_info.

For more information, see our NatsCode wiki.

Things to Remember

  • All three formats are interchangeable!
  • If moving from NATS v3 to NATS v4, your NATS3 link codes are 100% usable and compatable in NATS v4
  • The non-encoded formats are security-smart! If an affiliate alters a link code so that he/she sends traffic to a program that the affiliate does not belong to, or if they send traffic to a site/tour that does not belong to the program, the affiliate will not get paid out on any transactions that result from that traffic.
  • The non-encoded formats are NOT fool-proof! If an affiliate alters the link code so they are using a program they don't belong to or using a tour that doesn't belong to the site, they will not get desired payout or the surfer will not land on the right tour in most cases.

Deep Linking

Affiliates can link directly to a NATS pre-join page by appending /join to a linkcode. For example:


Affiliates can link to any other page on your site by appending a forward-slash and a relative URL to the link code. For example, using the following linkcode to link to

Affiliates can also manipulate the query string. For example, the affiliate can pass the variable extra_var=1234 to a tour by appending a question mark and the variable assignment to their linkcode: 

Affiliates can also link to any page and manipulate the query string. For example, the affiliate can pass the variable extra_var=1234 to /join by appending a question mark and the variable assignment to their linkcode: 

HTML / Embeded Linkcodes

In addition to the standard link styles offered, NATS4.1 also offers the ability to attach the HTML code that is necessary in order to provide surfers with hyperlinks containing your affiliate linkcode. Just choose either

  • Encoded with HTML
  • Un-Encoded with HTML
  • Shortname with HTML

These options will create embeded, hyperlinked linkcodes. If you want just the URL for your affiliate linkcodes without any HTML code attached, simply choose a option without HTML.

Choose how you would like your linkcodes to be displayed with the Affiliate Display Settings.

Redirecting to the Correct Page

When NATS turns a linkcode into a tour URL, it automatically appends a slash (/) to the end of barewords. You can prevent this by appending a question mark to the end of the URL. For example:

Tour URL Where Linkcodes Go

Qualified Link Codes

If there's a extra "t" in your linkcode, you probably grabbed the wrong link code from the top of the Sites edit page.<?=(!empty($_REQUEST['nats']) && !preg_match('/[\'\"<>()\\\+\[\]]/', $_REQUEST['nats']))?$_REQUEST['nats']:'MDowOjE'?>/page.html

The ttrack is used for qualified clicks; track is used for normal hits.