Skip to content

A rust wrapper around Google's gtag.js javascript framework.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

iamcodemaker/gtag-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gtag-js

A wrapper around Google's gtag.js framework.

Example

Ensure the gtag.js snippet has been properly installed before your wasm module runs. Instructions can be found in the gtag.js documentation.

Cargo.toml

[dependencies]
gtag-js = "0.2"
serde_json = "1.0"

lib.rs

use gtag_js::DataLayer;
use serde_json::json;

fn main() {
    let gtag = DataLayer::new("GA_MEASUREMENT_ID");

    gtag.push("config", json!({
        "page_title": "homepage",
        "page_path": "/home",
    }).unwrap();
}

gtm-js

A wrapper around Google's gtm.js snippet.

Example

Ensure the gtm.js snippet has been properly installed before your wasm module runs. Instructions can be found in the gtm.js documentation.

Cargo.toml

[dependencies]
gtm-js = "0.1"
serde_json = "1.0"

lib.rs

use serde_json::json;

fn main() {
    gtm_js::push("config", json!({
        "event": "pageview",
        "page_title": "homepage",
        "page_path": "/home",
    }).unwrap();
}

License

This project is licensed under either of

at your option.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

A rust wrapper around Google's gtag.js javascript framework.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages