getClientID

Tip. Working with the JavaScript API requires knowledge of HTML and JavaScript. If you don't know these languages, 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.getElementById('clientID').value = clientID;
});