GA4 ecommerce (Google Tag Manager) Send GA4 Purchase events

Standard

To send GA4 purchase events using Google Tag Manager (GTM), you will need to set up an GA4 property, create a GA4 ecommerce tag in GTM, and configure triggers to fire the tag when a purchase event occurs on your website.

Here are the specific steps for sending GA4 purchase events using GTM:

  1. Set up an GA4 property and get the GA4 measurement ID.
  2. Create a new GA4 ecommerce tag in GTM.
  3. Configure the tag to send data to the GA4 property using the measurement ID.
  4. Set up the triggers in GTM to fire the tag when a purchase event occurs on your website, such as when a “thank you” page is loaded after a purchase is made.
  5. To make sure that your data is accurate, you should also set up variables in GTM to capture ecommerce data such as transaction id, revenue, and product data.
  6. In the GA4 ecommerce tag make sure to call the GA4 ecommerce purchase event method, this is what triggers the purchase event.
  7. Publish the container and verify that the purchase events are being sent to GA4.

When sending a purchase event to Google Analytics 4 (GA4) using the GA4 ecommerce tag in Google Tag Manager (GTM), you can include various parameters to provide more information about the purchase. The purchase event in GA4 requires the following parameters:

  • transaction_id: A unique identifier for the transaction
  • revenue: The total revenue for the transaction
  • currency: The currency of the revenue
  • items: An array of objects representing the items in the transaction, including the following properties: name, item_id, price, quantity.

Here’s an example of how you might set up the purchase event in GTM:

dataLayer.push({
  event: "purchase",
  ecommerce: {
  'transaction_id': '{{transactionId}}',
  'value': {{totalRevenue}},
  'currency': '{{currency}}',
  'items': [
    {
      'item_name': '{{itemName}}',
      'item_id': '{{itemId}}',
      'price': {{itemPrice}},
      'quantity': {{itemQuantity}}
    },
    {
      'item_name': '{{itemName2}}',
      'item_id': '{{itemId2}}',
      'price': {{itemPrice2}},
      'quantity': {{itemQuantity2}}
    }
  ]
});

In this example, the purchase event is set up to use variables in GTM to capture the transaction id, total revenue, currency, and item data. These variables can be set up in GTM to pull data from the data layer or from the website’s HTML.

GA4 eCommerce Purchase Event

Purchase Event Parameters in Google Analytics 4 (GA4) using Google Tag Manager

Warning: If you do n’t know about javascript or do n’t have developing knowledge then do n’t try to GA4 ecommerce (Google Tag Manager) Send GA4 Purchase events that can broke your site, Cart and other functionality 

Disclaimer: Google tag manager belongs to Google property  For Contact: mappchero@gmail.com

I am available for Hire on Freelancer: Freelancer.com

I am available for Hire on Upwork: Upwork.com

I am available for Hire on Peopleperhour: Peopleperhour.com

I am available for Hire on Guru: Guru.com

Leave a Reply

Your email address will not be published. Required fields are marked *