Initializes Google Analytics
- API LEVEL
1- Functionality added
Project ID obtained through the Google Analytics control panel
Optional timeout in milliseconds before initialization aborts; defaults to 5000 ms
Example usage:
Eitri.tracking.GA.init("G-00000").then(gtag => {
gtag("event", "event_name", {
"debug_mode": true,
"page": "/MyPage"
})
}).catch(e => {
console.log("Eitri.tracking.GA.init.error: ", e)
});
event - Type of hit being sent to GA
debug_mode - Allows debugging this hit in GA
page - Example of a custom parameter
Generated using TypeDoc
Utility for tracking in Google Analytics