Metrica

hit

Attention! This signature is outdated. Supported for backward compatibility, but may be deprecated at any time. We strongly discourage its use. Use hit (url[, options]).
Manually sending pageview data for AJAX and Flash sites.

hit(url, [title[, referer[, params]]])

Parameter

Default value

Type

Description

url *
[no-highlight[

* Required parameter.

]no-highlight]

String

Current page URL.

title document.title

String

Page titles

referer

String

The URL of the page that the user loaded the current page contents from

params Session parameters

* Required parameter.

The url and referer parameters allow using URL paths without the schema (protocol) and host.

In this case, if a path starts with the / symbol, the URL is assumed to be set from the root of the host.

yaCounterXXXXXX.hit('/contacts');

Otherwise, the path is assumed to be relative to the current page.

yaCounterXXXXXX.hit('contacts', 'index.html?page=main');

Example

var yaCounterXXXXXX = new Ya.Metrika({id: XXXXXX});
//...
yaCounterXXXXXX.hit('#!contacts', 'Contacts', 'http://site.ru/#!main');