> For the complete documentation index, see [llms.txt](https://docs.toomuchmedia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_display_stats.md).

# nats\_display\_stats

*Article Topics:* [*Customization*](/getting-started/common-topics/customization.md)*,* [*Templates*](/getting-started/common-topics/templates.md)

Alias: display\_stats

## Parameters

| Parameter                                                                                                       | Description                                                       | Possible Values                                                                              | Default Value                                 | Example                  |
| --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------- | ------------------------ |
| [tpl](/nats-admin/skins-and-templates/further-reading/template-function-parameters/tpl.md)                      | Template used to display output                                   | Any valid template                                                                           | The template, *function\_display\_top\_stats* | tpl="mytemplate"         |
| [assign\_prefix](/nats-admin/skins-and-templates/further-reading/template-function-parameters/assign_prefix.md) | Prefix output variables with this word (see Output section below) | Any valid Smarty variable name                                                               | *Empty*                                       | assign\_prefix="mystats" |
| breakdown                                                                                                       | Show stats by these categories                                    | *See list of categories in Notes section below.* Can be a comma-separated list of categories | Date. Shows only stats by date                | breakdown="camp"         |
| period                                                                                                          | Show stats for this period                                        | *See list of periods in Notes section below.*                                                | Current. Shows stats for current period       | period="all"             |
| start                                                                                                           | Start date for freeform period. (See *period* parameter above)    | Any date                                                                                     | Yesterday. Starts with yesterday's stats      | start="1 January 2008"   |
| end                                                                                                             | End date for freeform period. (See *period* parameter above)      | Any date                                                                                     | Now. Ends with present stats                  | end="26 August 2008"     |
| no\_form\_vars                                                                                                  | Does not use parameters set by the user in a form                 | 0 or 1                                                                                       | 0. Uses form parameters                       | no\_form\_vars="1"       |
| no\_hits                                                                                                        | Don't report hits in output                                       | 0 or 1                                                                                       | 0. Reports hits                               | no\_hits="1"             |
| no\_transactions                                                                                                | Don't report transactions in output                               | 0 or 1                                                                                       | 0. Reports transactions                       | no\_transactions="1"     |
| no\_referral                                                                                                    | Don't report referrals in output                                  | 0 or 1                                                                                       | 0. Reports referrals                          | no\_referral="1"         |
| order                                                                                                           | What order to output stats                                        | ?                                                                                            | breakdown ASC                                 | ?                        |
| reference\_date                                                                                                 | ?                                                                 | 1                                                                                            | 0                                             | reference\_date="1"      |
| [data\_only](/nats-admin/skins-and-templates/further-reading/template-function-parameters/data_only.md)         | Set variables but don't display the template                      | 1                                                                                            | *None.* The template is displayed.            | data\_only=1             |

## Output

Outputs a list of statistics formatted by the parameter of the *tpl* argument. Also stores output in the variables or arrays listed below; variables are prefixed with the argument of the *assign\_prefix* parameter.

* .breaks
* .stats
* .total
* .breakdown
* .current\_period
* .filters
* .period\_start
* .period\_end

The following three variables are not prefixed with *assign\_prefix*:

* period\_options
* countries
* country\_iso

## Notes

The arguments for the parameter *breakdown,* described above, can either be of numbers or names. The table below lists the numbers, names and argument descriptions.&#x20;

| #  | Name    | Argument Description |
| -- | ------- | -------------------- |
| 0  | date    | Current Date         |
| 1  | camp    | Campaign             |
| 2  | prog    | Program              |
| 3  | site    | Site                 |
| 4  | tour    | Tour                 |
| 5  | option  | Option               |
| 6  | adtool  | Adtool               |
| 7  | subid1  | Sub ID #1            |
| 8  | subid2  | Sub ID #2            |
| 9  | biller  | Biller               |
| 10 | country | Country              |
| 11 | week    | Week                 |
| 12 | period  | Period               |
| 13 | month   | Month                |
| 14 | year    | Year                 |

The arguments for the parameter *period*, described above, can either be a number, a name, or a list of numbers or names. The table below lists the numbers, names, and argument descriptions.

| # | Name      | Argument Description                                       |
| - | --------- | ---------------------------------------------------------- |
| 0 | current   | Current Period                                             |
| 1 | last      | Last Period                                                |
| 2 | today     | Today                                                      |
| 3 | yesterday | Yesterday                                                  |
| 4 | week      | This Week                                                  |
| 5 | month     | This Month                                                 |
| 6 | year      | This Year                                                  |
| 7 | all       | All Time                                                   |
| 8 | free      | Freeform (See also the *start* and *end* parameters above) |

## See Also

* nats\_display\_stats\_calender -- displays a calendar that links to daily statistics


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_display_stats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
