hit

Attention. This signature is outdated. It's supported for backward compatibility, but may be deprecated at any time. We strongly discourage using it. Use hit (url[, options]).
Manually sending pageview data for AJAX and Flash sites.
ym(XXXXXX, 'hit', url, [title[, referer[, params]]]);

Parameter

Default value

Type

Description

url *

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 a / the URL is assumed to be set from the root of the host.

ym(XXXXXX, 'hit', '/contacts');

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

ym(XXXXXX, 'hit', 'contacts', 'Contacts');

Example

ym(XXXXXX, 'init', {});
//...
ym(XXXXXX, 'hit', '#!contacts', 'Contacts', 'http://example.com/#!main');