setUserID

Tip. Working with the JavaScript API requires knowledge of HTML and JavaScript. If you don't have these skills, contact your website developer or webmaster.

Transmitting the site user ID set by the site owner.

ym(XXXXXX, 'setUserID', "12345");

where

  • XXXXXX is the tag ID.
  • 12345 is a string value.

The setUserID method must be called during the session in order for the site user ID to be associated with the ClientID for a site visitor. To get more complete statistics, we recommend waiting some time until a larger volume of data is transmitted to Yandex.Metrica.