Magento 2 missing orders or transactions in Google Analytics (GA)

Installation and User Guide for Magento 2 Google Analytics Synchronization Extension

Table of Contents

  1. Installation
    • Installation via app/code
    • Installation via Composer
  2. Configuration Settings for Google Analytics Synchronization
    • General Settings
    • GA4
    • Select Store View
  3. Verify/Test Synced Transactions
    • GA4 Sync Log grid
    • GA4 Sync Log File
    • Google Analytics 4 Real Time Reports
    • Google Analytics 4 Custom Reports
  4. Order Tracking Information
  5. Create Project in Google Developer Console for GA Reporting API
  6. Getting View ID (Universal Analytics)
  7. Getting Property ID (GA4)
  8. Command to run the Synch Manually

Installation

https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer

Configuration Settings for Google Analytics Synchronization

Go to Admin > Stores > Configuration > Scommerce Configuration > Google Analytics Synchronization

General Settings

image (149).png

image (150).png

image (151).png

image (152).png

image (153).png


GA4

image (173).png

Select Store View

image (155).png

image (157).png

image (158).png

image (159).png

GA4

image (172).png

Verify/Test Synced Transactions

The synced transactions can be verified in two ways. Either checking the GA Sync logs or by checking the Real time reports in GA4 (as it takes 24 to48 hrs for GA4 to attribute data to reports realtime is the quickest way to verify).

image (178).png

After clicking on "GA Sync Logs", user would see the generated logs in the Sync Log Grid.

image (179).png

User can also use filters to check a particular log in the grid.

image (180).png

image (181).png

After downloading/viewing the file, user can check the logs. This file contains details of each synced transaction alongwith the order data that was sent, please refer to the image below:-

image (182).png

Google Analytics 4 Real Time Reports

Go to your Google Analytics 4 Property then from left menu click on reports:

image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png

Next, select realtime from the left menu and under the event name column you can find the purchase event by clicking on that you can verify the transaction ID that was sent through the sync module.

image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png

Google Analytics 4 Custom Reports

You can create a transaction report in GA4 using custom reports to verify the transactions received. For more information, please Click Here

Order Tracking Information

The order tracking info is captured against each order which is later used to sync the transactions to GA4 attributing them to correct sessions and dates to improve report accuracy. The order tracking info can be viewed by going into Admin>Sales>Order>Edit any order. Please refer to the screengrab below.

image (185).png

Create Project in Google Developer Console for GA Reporting API

Please follow the steps below to create project in Google developer console for GA reporting API and to obtain "application name" and "security key JSON File": -

Go to https://console.developers.google.com/. Click on the dropdown on the left as shown in the image below and a popup will appear on your screen.

image (163).png

Click on New Project

image (166).png

Enter your project name and Location then click on create.

image (165).png

Click on Enable APIS and SERVICES

image (167).png

In the next window search for Google Analytics Reporting API, this API gets used for GA4 along with Analytics Data API

image (168).png

Click on Enable to enable the API

image (169).png

Similarly enable the below API's as well:-

Click on Credentials from the left window then click on Create Credentials and choose service account.

image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png

In the next window, fill in your service account name and description then click on Create. An email will be automatically created as per your name. We need to add this email in google analytics. We will do it in the steps down below. Your service name will be your Application Name that you will enter in the configuration.

image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png

Click on continue without selecting a role.

image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png

image.png

image.png

image.png

Getting View ID (Universal Analytics)

Login to Your Google Analytics account and go to Admin>View Settings. You will be able to see your view Id there. You need to input this into the configuration as well.

image.png

Getting Property ID (GA4)

image.png

Command to run the Synch Manually

php bin/magento scommerce:analyticssync:synchronize

If you have a question related to this extension please check out our FAQ Section first. If you can't find the answer you are looking for then please contact support@scommerce-mage.com.


Revision #13
Created 25 April 2025 12:27:14 by Admin
Updated 3 March 2026 07:13:24 by scommerce