fr | en | es | de

Internal engine

Discover the latest tools in the
Analytics Suite, thanks to our new online help.

Contents: Hide



In order to use your website's internal search engine you need to:

<script type="text/javascript">


xt_mtcl = "";        //keyword value

xt_npg = "";        //result page number (0 when no result)

//do not modify below

if (window.xtparam!=null){window.xtparam+="&mc="+xt_mtcl+"&np="+xt_npg;}

else{window.xtparam ="&mc="+xt_mtcl+"&np="+xt_npg;};




- This code works with the xtcore.js file.
- The keyword which is to be placed in the xt_mtcl variable must be clean (there should be no spaces nor special characters such as accents etc)
- xt_npg is the number of the result page. If there is no result, write "0" in this variable: it will let you know which searches have generated no results.

If you want to find out which keywords Internet users have clicked on, all you need to do is add the following 3 variables to the destination URL:

- xtmc: must contain the keyword entered during the search (same label as the one placed in the page’s xt_mcl variable)

- xtnp: must contain the number of the results’ page which led to a click (same value as the page’s xt_npg variable)

- xtcr: must contain the position of the clicked result (whole number)


An Internet user enters the name of an artist (e.g. "my singer") in an on-line music catalogue with the following URL:

The user is then directed towards a page containing 20 results out of the 140 that have been found:

If you want to track this search, all you need to do is place the "Internal Search Engine" code on this page with xt_mtcl = "mysinger" and xt_npg = "1".

The Internet user then clicks on the 3rd link of the second page of results (in other words, the 23rd result). This link then directs the user to:

If you want to track this click, all you need to do is enter the 3 variables into the destination URL as shown in the example below:

The page, album.aspx, must contain at least one standard "web" tag code. This code will retrieve the 3 variables which have been added to the URL.

Version 3.4.003 and later of the xtcore.js file

For versions 3.4.003 and later of the xtcore.js file, it is possible to retrieve your own URL variables. This means that you do not have to enter the xt_mtcl and xt_npg variables on the results’ page. You do, however, need to declare the names of these variables in the xtcore.js file.

An example using version 3.4.003 of the xtcore file:

For example, you search result contains the following variables:
"mykeyword" is the parameter which contains the keyword's label, and "p3" is the parameter which contains the number of the results' page.

Instead of entering the following into the xtcore.js file:
...xt3=3650, xtkwv='xtmc', xtkwp='xtnp',xtadch=new Array,>...

You will enter:
...xt3=3650, xtkwv='mykeyword', xtkwp='p3',xtadch=new Array,>...

In this way the information will be retrieved automatically without having to enter the xt_mtcl and xt_npg variables.

Measuring search clicks from redirection

If you do not wish to add variables to the destination URL following a click on a search result, you can use the 2 classic methods available for measuring clicks (please refer to paragraphs earlier in this document on measuring clicks):

- measuring clicks using the “onclick” attribute by calling the xt_click() variable

- measuring clicks using redirection by calling the “go.url” and specifying “type=click”.


In both cases you need to:

- specify that “click=IS” to show that the click relates to a result from the internal search engine

- enter the 3 variables with an & between each one:

An example of measuring clicks by redirection

Let's take another look at an earlier example where the Internet user clicks on the 3rd link of the second page of results (np=2 and mcrg=23) after carrying out a search with "mysinger" (mc=mysinger)

Where the link of the click is as follows:
<a href="">

- To measure the click with xt_click(), you need to add the "onclick" attribute according to:
<a href="" onclick="return xt_click(this,'C','','&mc=mysinger&np=2&mcrg=23','IS')">
The only code to be modified is the code in orange. The other parameters (this, ‘C’ and ‘IS’) must be left as they are in the example.

- To measure the click with redirection, you need to replace the destination URL with one of our redirection URLs:

The codes to be modified are in orange:
- log: to be retrieved on the tag's code page
- s=yyy: your site ID
- url= is the URL which redirection will send Internet users to.