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

### <span style="color: rgb(59, 130, 246);">Installation and User Guide for Magento 2 Google Analytics Synchronization Extension</span>

****Table of Contents****

1. [Installation](#bkmrk-installation "Installation")
    - **Installation via app/code**
    - **Installation via Composer**
2. [Configuration Settings for Google Analytics Synchronization](#bkmrk-configuration-settin "Configuration Settings for Google Analytics Synchronization")
    - **General Settings**
    - **GA4**
    - **Select Store View**
3. [Verify/Test Synced Transactions](#bkmrk-verify%2Ftest-synced-t "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](#bkmrk-order-tracking-infor "Order Tracking Information")
5. [Create Project in Google Developer Console for GA Reporting API](#bkmrk-create-project-in-go "Create Project in Google Developer Console for GA Reporting API")
6. [Getting View ID (Universal Analytics)](#bkmrk-getting-view-id-%28uni "Getting View ID (Universal Analytics)")
7. [Getting Property ID (GA4)](#bkmrk-getting-property-id- "Getting Property ID (GA4)")
8. [Command to run the Synch Manually](#bkmrk-command-to-run-the-s "Command to run the Synch Manually")

### <span style="color: rgb(59, 130, 246);">Installation</span>

- ****Installation via app/code:****<span style="white-space: pre-wrap;"> Upload the content of the module to your root folder. This will not overwrite the existing Magento folder or files, only the new contents will be added. After the successful upload of the package, run below commands on Magento 2 root directory.</span>
- ****Installation via Composer:****<span style="white-space: pre-wrap;"> Please follow the guide provided in the below link to complete the installation via composer.</span>

<p class="callout success">[https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer](https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer)</p>

### <span style="color: rgb(59, 130, 246);">Configuration Settings for Google Analytics Synchronization</span>

<span style="white-space: pre-wrap;">Go to </span>****Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; Google Analytics Synchronization****

#### ****General Settings****

- ****Enabled –****<span style="white-space: pre-wrap;"> Select "Yes" or "No" to enable or disable the module.</span>
- ****Enabled –****<span style="white-space: pre-wrap;"> Select "Yes" or "No" to enable or disable synchronization with UA(Universal Analytics).</span>
- ****License Key –****<span style="white-space: pre-wrap;"> Please add the license for the extension which is provided in the order confirmation email. Please note license keys are site URL specific. If you require license keys for dev/staging sites then please email us at </span><support@scommerce-mage.com>.
- ****Application Name –****<span style="white-space: pre-wrap;"> It is the project name that you get from Google console. ( https://console.developers.google.com/ ) </span>[Click here for more information](https://console.cloud.google.com/)
- ****Security key (JSON) –****<span style="white-space: pre-wrap;"> Security key JSON file can be obtained from Google Console under account credentials. </span>[Click here for more information](#bkmrk-create-project-in-go "Click here for more information")
- ****Google View id –****<span style="white-space: pre-wrap;"> View Id can be obtained from Google Analytics. Go to Admin&gt;View Settings&gt;View ID.</span>
- ****Exclude order statuses –****<span style="white-space: pre-wrap;"> You can choose to exclude certain order statues from sync. These orders won't be synced with Google Analytics.</span>
- ****Orders day Skip –****<span style="white-space: pre-wrap;"> Enter the number of days you want to skip checking. For eg:- Suppose if you enter 2 then orders from 2days ago will be synced today.</span>
- ****Skip Hours-****<span style="white-space: pre-wrap;"> This setting works in conjunction with Order days skip" setting. When </span>****Order days skip****<span style="white-space: pre-wrap;"> is set to 0 then you can add hours here to allow number of hours to skip before considering transaction has been missing and sending it to GA. Default value is 4 and we will recommend to keep it that way because original transaction can take longer to appear in Google Analytics.</span>
- ****Send Base Data –****<span style="white-space: pre-wrap;"> Select whether you want to send base order data or store order data.</span>
- ****Send Phone or Admin Orders –****<span style="white-space: pre-wrap;"> Enabling this option will also sync orders placed from admin panel and phone</span>
- ****Source –****<span style="white-space: pre-wrap;"> Pass a source to Google for admin orders</span>
- ****Medium –****<span style="white-space: pre-wrap;"> Pass a medium to Google for admin orders</span>
- ****Brand Attribute –****<span style="white-space: pre-wrap;"> Select a brand attribute to send with brand names</span>
- ****Brand Text box –****<span style="white-space: pre-wrap;"> Input brand name to send to Google</span>
- ****Default Landing Page -****<span style="white-space: pre-wrap;"> This setting allows you to set default landing page value which shows in Google Analytics in case landing page is not available to sent as part of missing transaction.</span>
- ****Cron Schedule –****<span style="white-space: pre-wrap;"> Schedule specific cron time to run the sync automatically.</span>
- ****Debugging –****<span style="white-space: pre-wrap;"> Enabling debugging will generate a detailed log report in /var/log directory</span>
- ****Test Mode-****<span style="white-space: pre-wrap;"> This setting allows you to check missing transactions before we send the transactions to GA. It helps in validating the data before it gets posted to Google Analytics</span>

[![image (149).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-149.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-149.png)

[![image (150).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-150.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-150.png)

[![image (151).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-151.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-151.png)

[![image (152).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-152.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-152.png)

[![image (153).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-153.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-153.png)

#### ****GA4****

- ****Synch GA4 –****<span style="white-space: pre-wrap;"> Select "Yes" or "No" to enable or disable the GA4 sync.</span>
- ****API Secret –****<span style="white-space: pre-wrap;"> Enter the API secret key here. API secret key can be created by going into GA4&gt;Admin&gt;Data Streams&gt;Select website&gt;Measurement Protocol API Secrets&gt;Create enter the name and click on create to get the key.</span>
- ****Skip Order days –****<span style="white-space: pre-wrap;"> Enter the number of days that will be skipped before sending to GA4. Please put greater than 0 value. This is done to avoid duplicate transactions. For eg:- Suppose if you enter 2 then orders from 2days ago will be synced today.</span>
- ****Measurement ID –****<span style="white-space: pre-wrap;"> Enter the measurement ID of your GA4 property. Ga4 measurement ID can be extracted from </span>****GA4&gt;Admin&gt;Data Streams&gt;Select website and it is available in the top right corner.****
- ****Property ID –****<span style="white-space: pre-wrap;"> Enter the property ID of GA4. </span>****GA4&gt;Admin&gt;Property Settings&gt;Property ID****

[![image (173).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-173.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-173.png)

****Select Store View****

- ****Enabled –****<span style="white-space: pre-wrap;"> Select "Yes" or "No" to enable or disable the module.</span>
- ****Enabled –****<span style="white-space: pre-wrap;"> Select "Yes" or "No" to enable or disable synchronization with UA(Universal Analytics).</span>
- ****License Key –****<span style="white-space: pre-wrap;"> Please add the license for the extension which is provided in the order confirmation email. Please note license keys are site URL specific. If you require license keys for dev/staging sites then please email us at </span><support@scommerce-mage.com>
- ****Application Name –****<span style="white-space: pre-wrap;"> It is the project name that you get from Google console. ( https://console.developers.google.com/) </span>[Click here for more information](https://docs.scommerce-mage.com/magento-2-extensions/analytics-and-tracking-extensions/magento-2-missing-orders-or-transactions-in-google-analytics-ga#toc65169382)
- ****Security key (JSON) –****<span style="white-space: pre-wrap;"> Security key JSON file can be obtained from Google Console under account credentials.</span>[<span style="white-space: pre-wrap;"> Click here for more information</span>](https://docs.scommerce-mage.com/magento-2-extensions/analytics-and-tracking-extensions/magento-2-missing-orders-or-transactions-in-google-analytics-ga#toc65169382)
- ****Google View id –****<span style="white-space: pre-wrap;"> View Id can be obtained from Google Analytics. Go to Admin&gt;View Settings&gt;View ID.</span>
- ****Exclude order statuses –****<span style="white-space: pre-wrap;"> You can choose to exclude certain order statues from sync. These orders won't be synced with Google Analytics.</span>
- ****Analytics Account Id –****<span style="white-space: pre-wrap;"> It is your Google Analytics account ID.</span>
- ****Orders day Skip –****<span style="white-space: pre-wrap;"> Enter the number of days you want to skip checking. For eg:- Suppose if you enter 2 then orders from 2 days ago will be synced today.</span>
- ****Skip Hours-****<span style="white-space: pre-wrap;"> This setting works in conjunction with Order days skip" setting. When </span>****Order days skip****<span style="white-space: pre-wrap;"> is set to 0 then you can add hours here to allow number of hours to skip before considering transaction has been missing and sending it to GA. Default value is 4 and we will recommend to keep it that way because original transaction can take longer to appear in Google Analytics.</span>
- ****Send Base Data –****<span style="white-space: pre-wrap;"> Select whether you want to send base order data or store order data.</span>
- ****Send Phone or Admin Orders –****<span style="white-space: pre-wrap;"> Enabling this option will also sync orders placed from admin panel and phone</span>
- ****Source –****<span style="white-space: pre-wrap;"> Pass a source to Google for admin orders</span>
- ****Medium –****<span style="white-space: pre-wrap;"> Pass a medium to Google for admin orders</span>
- ****Brand Attribute –****<span style="white-space: pre-wrap;"> Select a brand attribute to send with brand names</span>
- ****Brand Text box –****<span style="white-space: pre-wrap;"> Input brand name to send to Google</span>
- ****Default Landing Page -****<span style="white-space: pre-wrap;"> This setting allows you to set default landing page value which shows in Google Analytics in case landing page is not available to sent as part of missing transaction.</span>

[![image (155).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-155.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-155.png)

[![image (157).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-157.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-157.png)

[![image (158).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-158.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-158.png)

[![image (159).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-159.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-159.png)

****GA4****

- ****Synch GA4 –****<span style="white-space: pre-wrap;"> Select "Yes" or "No" to enable or disable the GA4 sync.</span>
- ****API Secret –****<span style="white-space: pre-wrap;"> Enter the API secret key here. API secret key can be created by going into </span>****GA4&gt;Admin&gt;Data Streams&gt;Select website&gt;Measurement Protocol API Secrets&gt;Create enter the name and click on create to get the key.****
- ****Skip Order days –****<span style="white-space: pre-wrap;"> Enter the number of days that will be skipped before sending to GA4. Please put greater than 0 value. This is done to avoid duplicate transactions. For eg:- Suppose if you enter 2 then orders from 2days ago will be synced today.</span>
- ****Measurement ID –****<span style="white-space: pre-wrap;"> Enter the measurement ID of your GA4 property. Ga4 measurement ID can be extracted from </span>****GA4&gt;Admin&gt;Data Streams&gt;Select website and it is available in the top right corner.****
- ****Property ID –****<span style="white-space: pre-wrap;"> Enter the property ID of GA4. </span>****GA4&gt;Admin&gt;Property Settings&gt;Property ID****

[![image (172).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-172.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-172.png)

### <span style="color: rgb(59, 130, 246);">Verify/Test Synced Transactions</span>

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).

- ****GA Sync Log Grid:****<span style="white-space: pre-wrap;"> Go to </span>****System&gt; Manage GA Sync Logs&gt; GA Sync Logs****

[![image (178).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-178.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-178.png)

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

[![image (179).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-179.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-179.png)

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

[![image (180).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-180.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-180.png)

- ****GA4 Sync Log File:****<span style="white-space: pre-wrap;"> The GA Sync logs can be viewed by going into your server&gt;Magento installation directory&gt;Var&gt;log&gt;ga\_sync.log.</span>

[![image (181).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-181.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/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](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-182.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/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](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-3-1-1-1-1-1-1-1-1-1-1.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/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](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-3-1-1-1-1-1-1-1-1-1-1.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/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[<span style="white-space: pre-wrap;"> </span>****Click Here****](https://www.scommerce-mage.com/blog/how-to-create-transactions-report-in-google-analytics-4-ga4.html)

### <span style="color: rgb(59, 130, 246);">Order Tracking Information</span>

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&gt;Sales&gt;Order&gt;Edit any order. Please refer to the screengrab below.

[![image (185).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-185.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-185.png)

### <span style="color: rgb(59, 130, 246);">Create Project in Google Developer Console for GA Reporting API</span>

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/.****](https://console.cloud.google.com/apis/dashboard) ****Click on the dropdown on the left as shown in the image below and a popup will appear on your screen.****

[![image (163).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-163.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-163.png)

****Click on New Project****

[![image (166).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-166.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-166.png)

****Enter your project name and Location then click on create.****

[![image (165).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-165.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-165.png)

****Click on Enable APIS and SERVICES****

[![image (167).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-167.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/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](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-168.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-168.png)

****Click on Enable to enable the API****

[![image (169).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-169.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-169.png)

****Similarly enable the below API's as well:-****

- Google Analytics API (Used to access UA data)
- <span style="white-space: pre-wrap;">Google Analytics Data API (Used to access GA4 report Data) </span>[https://developers.google.com/analytics/devguides/reporting/data/v1?hl=en\_US](https://developers.google.com/analytics/devguides/reporting/data/v1?hl=en_US)

****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](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/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)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/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](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/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)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/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](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/image-2-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/image-2-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1.png)

- Click Continue again without any selection
- <span style="white-space: pre-wrap;">Click on Create Key from the image above and select json your key file will be downloaded. </span>****Place this key file in the VAR directory of your website****<span style="white-space: pre-wrap;">. Copy the exact name with extension ".json" and input it into </span>****security Key****<span style="white-space: pre-wrap;"> in the configuration.</span>

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/KBrimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/KBrimage.png)

- ****Login to your GA4 account. Go to Admin -&gt; Property -&gt; Property Access Management. Add the email we got in the steps above with "Viewer" or "Analyst" permissions.****

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/4EPimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/4EPimage.png)

- ****Login to your Universal Analytics account. Go to Admin &gt; User Management. Add the email we got in the steps above with "Viewer" or "Analyst" permissions.****

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/nv9image.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/nv9image.png)

### <span style="color: rgb(59, 130, 246);">Getting View ID (Universal Analytics)</span>

<span style="white-space: pre-wrap;">Login to Your Google Analytics account and go to </span>****Admin&gt;View Settings****<span style="white-space: pre-wrap;">. You will be able to see your </span>****view Id****<span style="white-space: pre-wrap;"> there. You need to input this into the configuration as well.</span>

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/huIimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/huIimage.png)

### <span style="color: rgb(59, 130, 246);">Getting Property ID (GA4)</span>

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/scaled-1680-/1fJimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-08/1fJimage.png)

### <span style="color: rgb(59, 130, 246);">Command to run the Synch Manually</span>

`<span class="editor-theme-code">php bin/magento scommerce:analyticssync:synchronize</span>`

<span style="white-space: pre-wrap;">If you have a question related to this extension please check out our </span>[****FAQ Section****<span style="white-space: pre-wrap;"> </span>](https://www.scommerce-mage.com/magento-2-delivery-date-and-instructions.html#customfaq)<span style="white-space: pre-wrap;">first. If you can't find the answer you are looking for then please contact </span>[****support@scommerce-mage.com****](mailto:core@scommerce-mage.com)****.****