Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can set categories to any page on your website and then use this category in the stats. NRich with N.Rich analytics. N.Rich Website tag allows two ways to perform this:

  1. Setup Define page category using the tag configuration

  2. Setup Define page category using javascript Javascript on the page

For correct operation, you should use 'utf-8' encoding on the page. Otherwise, only any non-Latin symbols will be saved correctlycorrupted. The page category should must not be no longer than 75 charscharacters.

...

Define page category via tag configuration

At the moment website tag looks like as followingSample of default N.Rich Website Tag code:

Code Block
languagejs
<script type="text/javascript">
    var config = {
      cookieless: true,
    };
    !function(n,a,t,i,f,y){n[t]=n[t]||function(){(n[t].q=n[t].q||
    []).push(arguments)},n[t].l=1*new Date,f=a.createElement(i),f.async=true,y=a.getElementsByTagName(i)[0]
    ,f.src='https://serve.nrich.ai/tracker/assets/tracker.js?'+t,y.parentNode.insertBefore(f,y)}
    (window,document,'nt','script'),nt('load','{tag_uuid}', config);
</script>

In the config configuration block you can specify the page_category parameter to mark this page with the desired category. See example:

Code Block
languagejs
<script type="text/javascript">
    var config = {
      cookieless: true,
      page_category: 'Automotive',
    };
    !function(n,a,t,i,f,y){n[t]=n[t]||function(){(n[t].q=n[t].q||
    []).push(arguments)},n[t].l=1*new Date,f=a.createElement(i),f.async=true,y=a.getElementsByTagName(i)[0]
    ,f.src='https://serve.nrich.ai/tracker/assets/tracker.js?'+t,y.parentNode.insertBefore(f,y)}
    (window,document,'nt','script'),nt('load','{tag_uuid}', config);
</script>

...

Define page category via

...

Javascript function call

Nrich Website Tag adds a special function into the page to perform additional actions. The name of the function is nt. You can use this function to setup define page category instead of as an alternative to using the tag configuration. Usage example of the function as follows:

Code Block
nt('set_meta', 'page_category', 'Business');

This function could may be called in any place at anywhere on the page after the NRich Website Tag installation. This function will add the specified page category . This function and can be called several times. If called several times, each call will update page category to a new value. See exampleExample:

Code Block
nt('set_meta', 'page_category', 'someexample_category1');
nt('set_meta', 'page_category', 'someexample_category2');
nt('set_meta', 'page_category', 'someexample_category3');

The result page category will be someexample_category3 as specified in the last call.

...