hit

Alert

This signature is outdated. It’s 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.

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', 'Contact information');

Example

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

Chat with us


* Required parameter.