{"repo":"beyonk/svelte-google-analytics","free":true,"listed":false,"github":"https://github.com/beyonk/svelte-google-analytics","clone":"git clone https://github.com/beyonk/svelte-google-analytics.git","description":"Google Analytics component for Svelte","language":"JavaScript","stars":77,"topics":["svelte","beyonk","google","google-analytics","svelte-google-analytics","vanillajs","tracking","seo","analytics"],"license":null,"category":"analytics","readme_excerpt":"Svelte Google Analytics Supports Google Analytics v4! Install the package Usage In App.svelte Component accepts two additional properties: enabled and configurations . The configurations property (optional) configurations props which accepts an object type with configurations for the properties. The key in this object is the id of the property. Example on disabling automatic pageviews for the id-1 property: The enabled property (optional) The enabled prop set to true by default. Logic can be added here to disable/enable analytics. If you disable tracking by default, for instance, due to GDPR, then you can enable it later by calling init() on your component: Page Tracking With Google Analytics v4, most basic events are automatic. See the docs (see Google Analytics offical docs - Pageviews) for more info &nbsp; Event Tracking All events specified in the documentation are implemeneted (generated automatically from scraping the docs pages and building the project!) Custom Events Custom events can be tracked with addEvent : Multiple Properties To send an event to a different property, specify the property id as the last parameter to the event: send to . Set User Properties To split user to different segment, such as language preference or geographic location, set the Properties with setUserProperties and setup custom dimension on Google Analytics dashboard. For more information see Google Analytics Documentation. Set User Id To identify user inside GA and link their sessions toget","default_branch":null,"files":null,"tree":[],"storefront":"/r/beyonk","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/beyonk/svelte-google-analytics/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}