Difference between revisions of "Includes Admin"

From TMM Wiki
Jump to navigationJump to search
 
(11 intermediate revisions by 7 users not shown)
Line 5: Line 5:
 
The new NATS4 Includes Admin provides an intuitive interface for
 
The new NATS4 Includes Admin provides an intuitive interface for
 
including a NATS [[ct#Template|template]] in another PHP file and using
 
including a NATS [[ct#Template|template]] in another PHP file and using
simple programing logic to determine exactly what a surfer sees.
+
simple programming logic to determine exactly what a surfer sees.
 
 
[[Image:Includes.cut.png|thumb|600px|The New NATS4 Includes Admin]]
 
  
 
== Skins and Templates Admin ==
 
== Skins and Templates Admin ==
 
Before you can use an include, you need to create a [[ct#Template|template]]. Go to
 
Before you can use an include, you need to create a [[ct#Template|template]]. Go to
[[Skins and Templates Admin]], edit the default skin, go to the Create
+
[[Skins and Templates Admin]] under the Special Templates section. You must select "chaininclude_" as the prefix. (For
Template section, and place your cursor in the Name field. Enter the
 
name of your template prefixed with the term, "chaininclude_". (For
 
 
example: "chaininclude_my_template".)  In the header drop-down, select,
 
example: "chaininclude_my_template".)  In the header drop-down, select,
 
"No Header"; in the footer drop-down, select, "No Footer."  Enter a
 
"No Header"; in the footer drop-down, select, "No Footer."  Enter a
Line 22: Line 18:
  
 
== Includes Admin ==
 
== Includes Admin ==
Go to Includes Admin, go to the bottom of the Include Chains table,
+
To continue configuring your new include, go to the Includes Admin. At the bottom of the Include Chains table, there will be a set of blank fields that you can fill in to create your new include. Fill in the chain name and select the default template you want to use. You can also change the [[Ct#Tour|tour]] and the [[Ct#Program|program]] encoded in the [[Ct#Linkcode|linkcode]], whether you want to track a surfer's actions, and decide if you want to enable your new Include Chain. Resetting the surfer's tracking cookie will count the surfer as a unique hit every time they view your new include.
and fill in the blank Chain Name field. Use the Default Template
+
 
drop-down to choose the template you just created. You may change the [[ct#Tour|tour]]
+
[[Image:Include chains.PNG|450px|The New NATS4 Includes Admin]]
and the [[ct#Program|program]] encoded in the [[Linkcode|linkcode]], reset the
 
[[ct#Surfer|surfer's]] tracking cookie, and enable this chain. Reseting the surfer's
 
tracking cookie counts the surfer as a unique hit every time they view
 
this include.
 
  
Click the View Rules (Purple Arrows) Icon to change the rules that
+
Click the View Rules (Purple Arrows) Icon to change the rules that determine who sees this include chain. Includes Admin rules follow the standard [[NATS]] hierarchy. A Hide rule will override all matching show rules, and a show rule will include the file even if you mark the include chain as disabled. [[NATS]] will automatically skip all Ignore rules.
determine who sees this include chain. A matching Hide rule
 
overrides all matching Show rules. A Show rule includes the file even if
 
you marked the include chain as disabled. NATS skips all Ignore rules.
 
  
[[Image:Rules.cut.png|thumb|600px|center|Editing Include Chain Rules]]
+
[[Image:Include rules.PNG|600px|Editing Include Chain Rules]]
  
Enter the rule's criteria. You can only enter one [[ct#Affiliate|affiliate's]] name in the
+
Enter the rule's criteria, such as affiliate, program, tour, etc. Only one [[Ct#Affiliate|affiliate's]] name can be in the Affiliate box, so if you would like to match more than one affiliate you must create an additional rule. You can enter any value PHP's [http://us.php.net/manual/en/function.strtotime.php strtotime] function can parse into the Start Date & Time and End Date & Time boxes.
Affiliate box. Use more than one rule to match more than one affiliate.
 
You can enter any value PHP's [http://us.php.net/manual/en/function.strtotime.php strtotime] function can parse into the
 
Start Date & Time and End Date & Time boxes.
 
  
NATS evaluates these rules every time a surfer requests a page from this
+
NATS evaluates these rules every time a surfer requests a page from this chain, so you can enter recurring times in the Start Time and End Time fields. For example, you can start a rule on Saturday and end it on Monday to only match during weekends. When you are done configuring your rule, click "Save Rule".
chain, so you can enter recurring times. For example, you can start a
 
rule on Saturday and end it on Monday to only match during weekends.
 
Click Add.
 
  
Click the View Steps (Magnifier) icon to change this include chain's
+
Click the View Steps (magnifying glass) icon to change this include chain's steps or add new steps. The template drop-downs let you show a different template than the Default Template, while the Tour Change and Program Change drop-downs override the chain's default Tour and Program changes. The Track button records a new hit every time this a surfer loads this include, the Don't Track button never records a new hit, and the Don't Change button uses the Set Tracking Cookie setting. The value of the URL field is passed to the included template; you can use it with the following [[Smarty]] variable:
steps. The template drop-downs lets you show a different template than
 
the Default Template. The Tour Change and Program Change drop-downs
 
override the chain's default Tour and Program changes. The Track button
 
records a new hit every time this a surfer loads this include, the Don't
 
Track button never records a new hit, and the Don't Change button uses
 
the Set Tracking Cookie setting. The value of the URL field is passed to the included template; you can use it with the following [[Smarty]] variable:
 
  
 
<pre>
 
<pre>
Line 60: Line 37:
  
  
[[Image:Steps.cut.png|thumb|600px|center|Editing Include Chain Steps]]
+
[[Image:Edit include chain.PNG|thumb|600px|center|Editing Include Chain Steps]]
  
 
== Including ==
 
== Including ==
On any web server that supports PHP, create a new web page and enter at
+
On any web server that supports PHP, you can create a new web page and enter at
 
least the following code. (Note: if your included file is only a HTML
 
least the following code. (Note: if your included file is only a HTML
 
fragment, you need to add your own HTML header and footer.)
 
fragment, you need to add your own HTML header and footer.)
Line 69: Line 46:
 
<pre>
 
<pre>
 
<?php
 
<?php
include('http://linkdomain/include.php/linkcode/chainid=0/tpl=0/orderid=0/track=0');
+
include('http://linkdomain/include.php/linkcode/chainid/tpl/orderid/track');
?>
 
</pre>
 
Another example including how to get the linkcode from the PHP request array. Please note you will want to set your own default code instead of MC4wLjUyLjUyLjAuMC4wLjA
 
<pre>
 
<?php
 
$nats = $_REQUEST['nats']?$_REQUEST['nats']:'MC4wLjUyLjUyLjAuMC4wLjA';
 
include ('http://linkdomain/include.php/'.$nats);
 
 
?>
 
?>
 
</pre>
 
</pre>
 
  
 
Replace ''linkdomain'' with your [[Link Domain|linkdomain]] or
 
Replace ''linkdomain'' with your [[Link Domain|linkdomain]] or
[[ct#Domain|domain]]. Replace ''linkcode'' with a linkcode.  
+
[[ct#Domain|domain]]. Replace ''linkcode'' with your preferred [[Ct#Linkcode|linkcode]].  
The other parameters are optional; the following table describes them.
+
The other parameters are optional, and the following table describes them:
  
 
{| class="tmplfunc" border="1"
 
{| class="tmplfunc" border="1"
Line 101: Line 70:
 
| tpl=chaininclude_my_other_template
 
| tpl=chaininclude_my_other_template
 
|-
 
|-
| orderid
+
| orderid*
 
| 0 or the number of any step in this chain
 
| 0 or the number of any step in this chain
 
| 0 (show the first step)
 
| 0 (show the first step)
Line 111: Line 80:
 
| track=true (track this hit as a unique)
 
| track=true (track this hit as a unique)
 
|}
 
|}
 +
<nowiki>*</nowiki> '''Notes''': The orderid is not the same as the stepid displayed in the Includes Admin. The orderid is the numerical order of the steps displayed in the Includes Admin for the given chain.
  
 
== Appendix: Using the Surfer's Session's Linkcode ==
 
== Appendix: Using the Surfer's Session's Linkcode ==
 
In your PHP include statement, you should send the surfer's linkcode.
 
In your PHP include statement, you should send the surfer's linkcode.
 
If the surfer doesn't have a linkcode, you should send the site's
 
If the surfer doesn't have a linkcode, you should send the site's
[[Default NATS Code|default NATS code]]. The following code will try to send the surfer's
+
[[NATSCode|default NATS code]]. The following code will try to send the surfer's
 
linkcode, but if the surfer doesn't have a linkcode, it will send the
 
linkcode, but if the surfer doesn't have a linkcode, it will send the
default linkcode. You need to replace the word ''natscode'' with your
+
default linkcode. You need to replace the word ''natscode'' in the following example with your
 
site's default natscode.
 
site's default natscode.
  
 
<pre>
 
<pre>
include 'http://linkdomain/include.php/'.?=$_REQUEST[nats]?$_REQUEST[nats]:natscode.'/chainid=0/tpl=0/orderid=0/track=0';
+
<?php
 +
$nats = (!empty($_REQUEST['nats']) && !preg_match('/[\'\"<>()\\\+\[\]]/', $_REQUEST['nats']))?$_REQUEST['nats']:'natscode';
 +
include ('http://linkdomain/include.php/'.$nats);
 +
?>
 
</pre>
 
</pre>
  
 
== Changing Site/Program ==
 
== Changing Site/Program ==
If you are changing the site or program inside of chain then you must use [[strack|NATS4_track_and_strack]] in your links to switch the tracking.  The $switch array will contain the following information for your new site/program:
+
If you are changing the site or program inside of the chain then you must use [[NATS4_track_and_strack|strack]] in your links to switch the tracking.  The $switch array will contain the following information for your new site/program:
 
* $switch.programid
 
* $switch.programid
 
* $switch.siteid
 
* $switch.siteid
Line 134: Line 107:
 
* $switch.subid2
 
* $switch.subid2
  
When using [[strack|NATS4_track_and_strack]] you'll only need to utilize $switch.programid and $switch.siteid, however, all the other variables are provided as well.
+
When using [[NATS4_track_and_strack|strack]] you'll only need to utilize $switch.programid and $switch.siteid, however, all the other variables are provided as well.
  
 
== See Also ==
 
== See Also ==
 
* [http://us.php.net/manual/en/function.strtotime.php strtotime] -- the PHP function that parses the Date & Time fields.  Note: NATS uses strtotime so that it can take a special "NEVER" parameter.
 
* [http://us.php.net/manual/en/function.strtotime.php strtotime] -- the PHP function that parses the Date & Time fields.  Note: NATS uses strtotime so that it can take a special "NEVER" parameter.
 +
 +
== Note ==
 +
 +
NATS4 no longer supports firing ''popup exit events'' natively. The code that NATS3 was using appears to no longer be supported in browsers. If you have javascript code that can perform popups, [http://clients.toomuchmedia.com/ we can assist] in configuring the Chain in the Includes Admin.
  
 
[[Category:NATS4 Administrator Guide]]
 
[[Category:NATS4 Administrator Guide]]
 +
[[Category:NATS4 Includes]]

Latest revision as of 14:39, 19 May 2017

NATS 4
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
Includes Admin
The Includes Admin
The Promotionals Admin
IntelliChat

The new NATS4 Includes Admin provides an intuitive interface for including a NATS template in another PHP file and using simple programming logic to determine exactly what a surfer sees.

Skins and Templates Admin

Before you can use an include, you need to create a template. Go to Skins and Templates Admin under the Special Templates section. You must select "chaininclude_" as the prefix. (For example: "chaininclude_my_template".) In the header drop-down, select, "No Header"; in the footer drop-down, select, "No Footer." Enter a description and click the Create button.

On the next page, enter into the template body the HTML you want included. Click Save Template.

Includes Admin

To continue configuring your new include, go to the Includes Admin. At the bottom of the Include Chains table, there will be a set of blank fields that you can fill in to create your new include. Fill in the chain name and select the default template you want to use. You can also change the tour and the program encoded in the linkcode, whether you want to track a surfer's actions, and decide if you want to enable your new Include Chain. Resetting the surfer's tracking cookie will count the surfer as a unique hit every time they view your new include.

The New NATS4 Includes Admin

Click the View Rules (Purple Arrows) Icon to change the rules that determine who sees this include chain. Includes Admin rules follow the standard NATS hierarchy. A Hide rule will override all matching show rules, and a show rule will include the file even if you mark the include chain as disabled. NATS will automatically skip all Ignore rules.

Editing Include Chain Rules

Enter the rule's criteria, such as affiliate, program, tour, etc. Only one affiliate's name can be in the Affiliate box, so if you would like to match more than one affiliate you must create an additional rule. You can enter any value PHP's strtotime function can parse into the Start Date & Time and End Date & Time boxes.

NATS evaluates these rules every time a surfer requests a page from this chain, so you can enter recurring times in the Start Time and End Time fields. For example, you can start a rule on Saturday and end it on Monday to only match during weekends. When you are done configuring your rule, click "Save Rule".

Click the View Steps (magnifying glass) icon to change this include chain's steps or add new steps. The template drop-downs let you show a different template than the Default Template, while the Tour Change and Program Change drop-downs override the chain's default Tour and Program changes. The Track button records a new hit every time this a surfer loads this include, the Don't Track button never records a new hit, and the Don't Change button uses the Set Tracking Cookie setting. The value of the URL field is passed to the included template; you can use it with the following Smarty variable:

{$params.url}


Editing Include Chain Steps

Including

On any web server that supports PHP, you can create a new web page and enter at least the following code. (Note: if your included file is only a HTML fragment, you need to add your own HTML header and footer.)

<?php
include('http://linkdomain/include.php/linkcode/chainid/tpl/orderid/track');
?>

Replace linkdomain with your linkdomain or domain. Replace linkcode with your preferred linkcode. The other parameters are optional, and the following table describes them:

Parameter Arguments Default Example
chainid 0 or any chain ID number 0 (uses the lowest-numbered enabled chain or the lowest-numbered chain with a matching show rule and no matching hide rule) chainid=2 (use chain number two)
tpl 0 or the name of a chaininclude_ template 0 (show the step's default template) tpl=chaininclude_my_other_template
orderid* 0 or the number of any step in this chain 0 (show the first step) orderid=7
track 0, true, or false 0 (use the default tracking setting) track=true (track this hit as a unique)

* Notes: The orderid is not the same as the stepid displayed in the Includes Admin. The orderid is the numerical order of the steps displayed in the Includes Admin for the given chain.

Appendix: Using the Surfer's Session's Linkcode

In your PHP include statement, you should send the surfer's linkcode. If the surfer doesn't have a linkcode, you should send the site's default NATS code. The following code will try to send the surfer's linkcode, but if the surfer doesn't have a linkcode, it will send the default linkcode. You need to replace the word natscode in the following example with your site's default natscode.

<?php
$nats = (!empty($_REQUEST['nats']) && !preg_match('/[\'\"<>()\\\+\[\]]/', $_REQUEST['nats']))?$_REQUEST['nats']:'natscode';
include ('http://linkdomain/include.php/'.$nats);
?>

Changing Site/Program

If you are changing the site or program inside of the chain then you must use strack in your links to switch the tracking. The $switch array will contain the following information for your new site/program:

  • $switch.programid
  • $switch.siteid
  • $switch.tourid
  • $switch.campaignid
  • $switch.adtoolid
  • $switch.subid1
  • $switch.subid2

When using strack you'll only need to utilize $switch.programid and $switch.siteid, however, all the other variables are provided as well.

See Also

  • strtotime -- the PHP function that parses the Date & Time fields. Note: NATS uses strtotime so that it can take a special "NEVER" parameter.

Note

NATS4 no longer supports firing popup exit events natively. The code that NATS3 was using appears to no longer be supported in browsers. If you have javascript code that can perform popups, we can assist in configuring the Chain in the Includes Admin.