Skip to content

byteark/byteark-player-react-google-analytic-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of ByteArk Player React send event to Google Analytics

This project is an example usage for sending event to google analytic from ByteArk Player React.

Requirements

  • ByteArk Player React v1.0.0-beta14^
  • Google Analytics Measurement ID

Installation

  1. Add gtag script tag inside <head> tag
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
  1. Add gtag configuration to your page setup function e.g. useEffect
window.dataLayer = window.dataLayer || [];
    function gtag(){window.dataLayer.push(arguments);}
    gtag('js', new Date());
  
    gtag('config', 'GA_MEASUREMENT_ID');
    window.gtag = gtag;

Send event to Google Analytic

window.gtag('event', 'ACTION', { metadata });

Read more

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published