MAS:NATS codes

From Mansion Productions WIKI
Jump to: navigation, search

Preservation of NATS referring codes throughout MAS tour pages

In case you are using NATS by TooMuchMedia, you need to take special care about your affiliate referring codes to make sure they are properly carried over through all MAS-generated tour pages all the way to the join page. Otherwise your affiliates might not get credited for the traffic they referred.

Note that nothing of this will be required if you use MPA3 by Mansion Productions!

Most likely NATS have provided a code like this to use at the join links:

  • <a href="//<?=$_REQUEST['nats']?$_REQUEST['nats']:'MDowOjE'?>&step=2">JOIN</a>

Do not use that, but follow the steps below.

At the top of all of your tour templates put this piece of code:

<?php if (!$uvar) { if ($nats) $uvar=$nats; else $nats='MDowOjE'; } else { if (!$nats) $nats=$uvar; } ?>

and there replace MDowOjE with your NATS code for default type-in tracking.

Then, further down the template, use this code to link to join page:

  • <a href="//<?=$nats;?>&step=2">JOIN</a>

Of course, edit the link above to match your site actual join page, the &step= parameter etc. The only important MAS-related thing in this link is this part: ?nats=<?=$nats;?>

The cross-assignment between the nats and uvar variables makes sure that the code will be carried over through any MAS-generated page links (result of [ahref] [groupref] [relref] [nextpage] [prevpage] [pages] tags), it will make it through the gallery and container pages as well.

Carrying the nats/uvar variables between pages in the main navigation.

MAS will be taking care of adding the uvar/nats variables to page links it has generated, but will not do it to any hard-coded links in the templates, including the main site navigation. To do so, you have to use append the tag [uvarpass] to all such links, for example:

  • <a href="show.php?a=101_1[uvarpass]
  • <a href="index.php?[uvarpass]

Note, in the second example, if the URL you're appending [uvarpass] to does not contain a query string (a question mark followed by list of name=value parameters), you need to add the question mark before the tag.

To pass the nats code to an external page (not one of the MAS aux files):

append <?=$nats?"?nats=$nats":"";?> to the link URL if it does not have a query string, or
append <?=$nats?"&nats=$nats":"";?> to the link URL if it does

For example:

  • <a href="/blog/<?=$nats?"?nats=$nats":"";?>">BLOG</a>
  • <a href="/script.php?a=1&b=2<?=$nats?"&nats=$nats":"";?>">title</a>

Carrying the nats/uvar variables through search functions

If your tour templates are utilizing MAS search functions, then follow the guidelines below; otherwise - ignore.

  • In search forms, located in section templates, the following code must be added beneath the hidden input form fields:
<?=($uvar?'<input type="hidden" name="uvar" value="'.$uvar.'">':"");?>
  • In JavaScript search() functions (copied from the MAS manual), the last line of code (somewhere present with eval('self.location...'), somewhere with 'location.href=...) must be changed to:
Pay special attention if your template implementation of the search() function does include a "&categories=..." value in that line of code, or looks somewhat different than the above example. If it does, please contact support for additional help with the correct syntax.
Personal tools