gtag_js_sys/lib.rs
1#![ deny(missing_docs)]
2
3//! This crate provides a wrapper around Google's gtag.js tagging framework.
4//!
5//! To use this crate the `gtag()` javascript function must have already been defined as described
6//! in the relevant [documentation].
7//!
8//! [documentation]: https://developers.google.com/gtagjs/devguide/snippet
9
10use wasm_bindgen::prelude::*;
11
12#[wasm_bindgen]
13extern {
14 /// Send event data.
15 #[wasm_bindgen(js_name = gtag)]
16 pub fn gtag(cmd: &str, id: &str);
17
18 /// Send event data with parameters.
19 #[wasm_bindgen(js_name = gtag)]
20 pub fn gtag_with_parameters(cmd: &str, id: &str, params: &JsValue);
21}