Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work api method - getClientID #10

Open
bratva opened this issue Dec 27, 2017 · 1 comment
Open

Doesn't work api method - getClientID #10

bratva opened this issue Dec 27, 2017 · 1 comment

Comments

@bratva
Copy link

bratva commented Dec 27, 2017

Hello.

Yandex Metrika has method getClientID. This method return some value.

yaCounterXXXXXX.getClientID() // id

But i can't take this value in ym:

ym('getClientID') // undefined

https://yandex.ru/support/metrika/objects/get-client-id.html

@narkq
Copy link
Owner

narkq commented Dec 27, 2017

Well, ym is written with fire-and-forget use case in mind, so apparently it won't work.
I would suggest two possible solutions:

  • if you're sure that the counter is ready by the time you're going to call getClientID, then just use window['yaCounterXXXXXX'].getClientID(), it's there;
  • otherwise, ym could probably rely on triggerEvent parameter and return a promise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants