getClientID

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.

Gets the site user ID assigned by Yandex.Metrica.

ym(XXXXXX, 'getClientID', function(clientID) {  <function body>});

Response format:

"12345"

where

  • XXXXXX is the tag ID.
  • 12345 is a string value.
Example
ym(XXXXXX, 'getClientID', function(clientID) {
  document.getElemetById('clientID').value = clientID;
});