Google Anaytics DataLayer To Segment Event

Google Analytics 4 Developer with implementation guideline for web & application click here

Segment Customer data platform implementation guideline Click here

1. Product Detail Stage  

Once a user selects or view an item from the list, send the select_item event with the selected item in an items array parameter.

2. Cart Stage  

Measure an item being added to a shopping cart by sending an add_to_cart event with the relevant items in an items array

3. Checkout Stage  

Measure the first step in a checkout process by sending a begin_checkout event with one or more items defined with the relevant fields.

4. Purchase Stage  

Measure a purchase by sending a purchase event with one or more items defined with the relevant fields.

5. Custom Event  

if your want to send a custom event to google analytics make sure your create event parameter both ga4 and datalayer.

Debugging

 const dataLayer = 
                { "event" : name ,
                   "ecommerce" : ..,    
            }