Difference between revisions of "Includes Admin"
TMMMikeSopko (talk | contribs) |
|||
(8 intermediate revisions by 5 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 | + | simple programming logic to determine exactly what a surfer sees. |
− | |||
− | |||
== 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]] | + | [[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, | 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 == | ||
− | + | 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 the [[ | ||
− | |||
− | tracking cookie | ||
− | |||
− | + | [[Image:Include chains.PNG|450px|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. |
− | + | [[Image:Include rules.PNG|600px|Editing Include Chain Rules]] | |
− | |||
− | |||
− | |||
− | + | 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. | |
− | |||
− | |||
− | |||
− | Click the View Steps ( | + | 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". |
− | steps. The template drop-downs | + | |
− | the Default Template | + | 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: |
− | 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: | + | [[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 74: | Line 51: | ||
Replace ''linkdomain'' with your [[Link Domain|linkdomain]] or | Replace ''linkdomain'' with your [[Link Domain|linkdomain]] or | ||
− | [[ct#Domain|domain]]. Replace ''linkcode'' with | + | [[ct#Domain|domain]]. Replace ''linkcode'' with your preferred [[Ct#Linkcode|linkcode]]. |
− | The other parameters are optional | + | The other parameters are optional, and the following table describes them: |
{| class="tmplfunc" border="1" | {| class="tmplfunc" border="1" | ||
Line 103: | 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. | + | <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 | ||
− | [[ | + | [[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> | ||
<?php | <?php | ||
− | $nats = $_REQUEST['nats']?$_REQUEST['nats']:'natscode'; | + | $nats = (!empty($_REQUEST['nats']) && !preg_match('/[\'\"<>()\\\+\[\]]/', $_REQUEST['nats']))?$_REQUEST['nats']:'natscode'; |
include ('http://linkdomain/include.php/'.$nats); | 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 | + | 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 129: | Line 107: | ||
* $switch.subid2 | * $switch.subid2 | ||
− | When using [[strack | + | 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
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.
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.
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}
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.