com.yandex.metrica
Class AppMetricaJsInterface
java.lang.Object
com.yandex.metrica.AppMetricaJsInterface
public class AppMetricaJsInterface
extends java.lang.Object
This class is used as a bridge between Javascript and native code. It allows to report AppMetrica events directly from JS code. For more info see method descriptions.
Constructor Summary
Constructor and Description |
---|
AppMetricaJsInterface(com.yandex.metrica.impl.proxy.YandexMetricaProxy proxy) |
Method Summary
Modifier and Type | Method and Description |
---|---|
void | reportEvent(java.lang.String name, java.lang.String value)
Reports event with name and json value to AppMetrica from JS code.
|
Method Detail
reportEvent
public void reportEvent(java.lang.String name, java.lang.String value)
Reports event with name and json value to AppMetrica from JS code. Example of usage in JS:
function reportToAppMetrica() {
// you can skip this check if you guarantee that it is always present
if (typeof(AppMetrica) !== 'undefined') {
AppMetrica.reportEvent("My name", "{}");
}
}
- Parameters:
name
- event namevalue
- event value in json format