LogoLogo
  • Magento 2 Extensions
    • SEO Extensions
      • Magento 2 Canonical Urls for Category, Product, CMS, and Other pages
      • Magento 2 Advanced SEO Suite
      • Magento 2 Cross Linking SEO
      • Magento 2 Google Page Speed Optimizer
      • Magento 2 Google Site Map Exclusion
      • Magento 2 Alternate Hreflang Tags
      • Magento 2 Google Rich Snippets
      • Magento 2 SEO Unique Catalog URLs
    • Site Speed Extensions
      • Magento 2 Full Page Cache Warmer
      • Magento 2 Google Page Speed Optimizer
      • Magento 2 Image Optimizer
      • Magento 2 AJAX Infinite Scroll
      • Magento 2 Lazy Load Image
    • Marketing Extensions
      • Magento 2 How Did You Hear About Us
      • Magento 2 Free Shipping Bar
      • Magento 2 Product Scheduler
      • Magento 2 Apply Discount coupon Code Via Link
      • Magento 2 Dynamic Sale Catagory
      • Magento 2 Facebook Conversion and Audience Pixel Tracking
      • Magento 2 Google Dynamic Remarketing Tag
      • Magento 2 Perfect Audience Tracking
      • Magento 2 Product Feed
      • Magento 2 Cash Back Discount
      • Magento 2 Competition or Prize Draw with Social Booster
      • Magento2 Custom Options Discount
      • Magento 2 Product Label
    • Analytics & Tracking Extensions
      • Magento 2 Google Global Site Tag (gtag.js) with GA4(Google Analytics 4) Enabled
      • Magento 2 Google Enhanced Ecommerce Tracking
      • Magento 2 Google Tag Manager (GTM) GA4 Ecommerce Tracking
      • Magento 2 Google Tag Manager Tracking
      • Magento 2 missing orders or transactions in Google Analytics (GA)
      • Magento 2 Consent mode's setup guide
    • Payment and Shipping Extensions
      • Magento 2 Delivery Instructions and Delivery Date
      • Magento 2 Product Handling or Additional Fee
      • Magento 2 Surcharge or Additional Fee
      • Magento 2 Shipping Carrier Tracker
    • User Experience Extensions
      • Magento 2 How Did You Hear About Us
      • Magento 2 FAQ
      • Magento 2 Subcategory Grid/List Extension
      • Magento 2 Ajax Login and Add to Wishlist
      • Magento 2 Custom Stock Status Extension
      • Magento 2 Product Shelf Life
      • Magento 2 VAT Exemption
      • Magento 2 Cancel Order by Customer on the Frontend
      • Magento 2 Lazy Load Image
      • Magento 2 AJAX Infinite Scroll
      • Magento 2 Previously Ordered Products
      • Magento 2 Social Login
      • Magento 2 Substitute Products
      • Magento 2 Product 360 view
      • Magento 2 Product Reviews
    • Admin Extensions
      • Magento 2 Update Order Email Address
      • Magento 2 Admin Action Log
      • Magento 2 Ajax Login and Add to Wishlist
      • Magento 2 Custom Stock Status Extension
      • Magento 2 Product Shelf Life
      • Magento 2 Repeat Order
      • Magento 2 Associated or Linked Product Stock Update
      • Magento 2 VAT Exemption
      • Magento 2 Order Delete or Archive
      • Magento 2 Order Tagger
      • Magento 2 Subcategory Grid/List Extension
      • Magento 2 Advanced Reporting Extension
      • Magento 2 Export Custom Product Attribute
      • Magento 2 Advanced Admin Login Security
      • Magento 2 Admin Security Checklist
      • Magento 2 Security Suite
      • Magento 2 AI Content Generator
      • Magento 2 Content Security Policy (CSP) Whitelist Manager
      • Magento 2 OTP Login
      • Magento 2 Admin Account Switcher
    • Data & Privacy Extensions
      • Magento 2 Not On The High Street Integration
      • Magento 2 GDPR Compliance: Anonymisation of order data
      • Magento 2 Antispam Extension
    • Integration Extensions
      • Magento 2 Diamond Search
      • Magento 2 Not On The High Street Integration
      • Magento 2 Creditsafe Integration
    • Installation Via Composer
  • Magento 1 Extension
    • SEO Extensions
      • Magento SEO Unique Catalog URLs
      • Jquery Asynchronous Image Loader (JAIL)
      • Magento Image Optimizer
      • Canonical Urls for Category, Product and CMS pages
      • Google Site Map Exclusion with Image sitemap
      • Google Friendly SEO Layered Navigation
      • Magento Rich Snippets & Cards (schema.org)
      • Meta Information for Any Page
    • Marketing Extensions
      • Where Did You Hear About Us?
      • Google Tag Manager Tracking
      • Google AdWords Conversion Tracking
      • Order Follow Up or Review Booster
      • Competition or Prize Draw Module with Social Booster
      • Apply Discount Coupon Code via Link
      • Abandoned Basket Email Alert
      • Cash Back Discount
      • Dynamic Sale Category
    • Analytics & Tracking Extensions
      • Google AdWords Conversion Tracking
      • Google Adwords Dynamic Remarketing Tag
      • Facebook Conversion and Audience Pixel Tracking
      • Perfect Audience Tracking
      • Google Enhanced Ecommerce Tracking
      • Magento 1 / OpenMage GA4 Google Tag Manager (GTM)
      • Magento 1 Google Global Site Tag (gtag.js)
      • Magento 1 Consent mode's setup guide
      • Magento 1 Google Analytics Synchronization Extension
    • Payment and Shipping Extensions
      • Magento Delivery Instructions or Order Comments
      • Surcharge or Additional Fee
      • Magento Surcharge or Additional Fee on Payment Method or Countries
    • User Experience Extensions
      • Product Image Resize
      • Magento Delivery Instructions or Order Comments
      • Single Product Category Redirect
      • Testimonials
    • Admin Extensions
      • Admin Order Email
      • Magento Update Order Email Address
      • Product Review Administrator Notification Email
      • Automated Product Publish Date
      • Order Follow Up or Review Booster
      • Custom Variables Anywhere
      • Testimonials
    • Data & Privacy Extensions
      • EU Cookie Notification
      • Magento 1 GDPR Compliance: Anonymisation of order data
    • Site Speed Extensions
      • Product Image Resize
      • Jquery Asynchronous Image Loader (JAIL)
      • Magento Image Optimizer
Powered by GitBook
On this page
  • Installation and User Guide for Magento 2 Google Analytics Synchronization Extension
  • Installation
  • Configuration Settings for Google Analytics Synchronization
  • Verify/Test Synced Transactions
  • Order Tracking Information
  • Create Project in Google Developer Console for GA Reporting API
  • Getting View ID (Universal Analytics)
  • Getting Property ID (GA4)
  • Command to run the Synch Manually

Was this helpful?

Export as PDF
  1. Magento 2 Extensions
  2. Analytics & Tracking Extensions

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

PreviousMagento 2 Google Tag Manager TrackingNextMagento 2 Consent mode's setup guide

Last updated 8 months ago

Was this helpful?

Installation and User Guide for Magento 2 Google Analytics Synchronization Extension

Table of Contents

    • Installation via app/code

    • Installation via Composer

    • General Settings

    • GA4

    • Select Store View

    • GA4 Sync Log grid

    • GA4 Sync Log File

    • Google Analytics 4 Real Time Reports

    • Google Analytics 4 Custom Reports

Installation

  • Installation via app/code: 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.

composer require google/apiclient:^2.9
composer require google/analytics-data:^0.8.1
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
  • Installation via Composer: Please follow the guide provided in the below link to complete the installation via composer.

Configuration Settings for Google Analytics Synchronization

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

General Settings

  • Enabled – Select “Yes” or “No” to enable or disable the module.

  • Enabled – Select “Yes” or “No” to enable or disable synchronization with UA(Universal Analytics).

  • Google View id – View Id can be obtained from Google Analytics. Go to Admin>View Settings>View ID.

  • Exclude order statuses – You can choose to exclude certain order statues from sync. These orders won’t be synced with Google Analytics.

  • Orders day Skip – 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.

  • Skip Hours- This setting works in conjunction with Order days skip" setting. When Order days skip 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.

  • Send Base Data – Select whether you want to send base order data or store order data.

  • Send Phone or Admin Orders – Enabling this option will also sync orders placed from admin panel and phone

  • Source – Pass a source to Google for admin orders

  • Medium – Pass a medium to Google for admin orders

  • Brand Attribute – Select a brand attribute to send with brand names

  • Brand Text box – Input brand name to send to Google

  • Default Landing Page - 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.

  • Cron Schedule – Schedule specific cron time to run the sync automatically.

  • Debugging – Enabling debugging will generate a detailed log report in /var/log directory

  • Test Mode- 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

GA4

  • Synch GA4 – Select “Yes” or “No” to enable or disable the GA4 sync.

  • API Secret – Enter the API secret key here. API secret key can be created by going into GA4>Admin>Data Streams>Select website>Measurement Protocol API Secrets>Create enter the name and click on create to get the key.

  • Skip Order days – 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.

  • Measurement ID – Enter the measurement ID of your GA4 property. Ga4 measurement ID can be extracted from GA4>Admin>Data Streams>Select website and it is available in the top right corner.

  • Property ID – Enter the property ID of GA4. GA4>Admin>Property Settings>Property ID

Select Store View

  • Enabled – Select “Yes” or “No” to enable or disable the module.

  • Enabled – Select “Yes” or “No” to enable or disable synchronization with UA(Universal Analytics).

  • Google View id – View Id can be obtained from Google Analytics. Go to Admin>View Settings>View ID.

  • Exclude order statuses – You can choose to exclude certain order statues from sync. These orders won’t be synced with Google Analytics.

  • Analytics Account Id – It is your Google Analytics account ID.

  • Orders day Skip – 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.

  • Skip Hours- This setting works in conjunction with Order days skip" setting. When Order days skip 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.

  • Send Base Data – Select whether you want to send base order data or store order data.

  • Send Phone or Admin Orders – Enabling this option will also sync orders placed from admin panel and phone

  • Source – Pass a source to Google for admin orders

  • Medium – Pass a medium to Google for admin orders

  • Brand Attribute – Select a brand attribute to send with brand names

  • Brand Text box – Input brand name to send to Google

  • Default Landing Page - 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.

GA4

  • Synch GA4 – Select “Yes” or “No” to enable or disable the GA4 sync.

  • API Secret – Enter the API secret key here. API secret key can be created by going into GA4>Admin>Data Streams>Select website>Measurement Protocol API Secrets>Create enter the name and click on create to get the key.

  • Skip Order days – 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.

  • Measurement ID – Enter the measurement ID of your GA4 property. Ga4 measurement ID can be extracted from GA4>Admin>Data Streams>Select website and it is available in the top right corner.

  • Property ID – Enter the property ID of GA4. GA4>Admin>Property Settings>Property ID

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

  • GA Sync Log Grid: Go to System> Manage GA Sync Logs> GA Sync Logs

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

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

  • GA4 Sync Log File: The GA Sync logs can be viewed by going into your server>Magento installation directory>Var>log>ga_sync.log.

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:-

Google Analytics 4 Real Time Reports

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

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.

Google Analytics 4 Custom Reports

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.

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”: -

Click on New Project

Enter your project name and Location then click on create.

Click on Enable APIS and SERVICES

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

Click on Enable to enable the API

Similarly enable the below API's as well:-

  • Google Analytics API (Used to access UA data)

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

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.

Click on continue without selecting a role.

  • Click Continue again without any selection

  • Click on Create Key from the image above and select json your key file will be downloaded. Place this key file in the VAR directory of your website. Copy the exact name with extension “.json” and input it into security Key in the configuration.

  • Login to your GA4 account. Go to Admin -> Property -> Property Access Management. Add the email we got in the steps above with “Viewer” or "Analyst" permissions.

  • Login to your Universal Analytics account. Go to Admin > User Management. Add the email we got in the steps above with “Viewer” or "Analyst" permissions.

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.

Getting Property ID (GA4)

Command to run the Synch Manually

php bin/magento scommerce:analyticssync:synchronize

License Key – 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 .

Application Name – It is the project name that you get from Google console. ( https://console.developers.google.com/ )

Security key (JSON) – Security key JSON file can be obtained from Google Console under account credentials.

License Key – 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

Application Name – It is the project name that you get from Google console. ( https://console.developers.google.com/)

Security key (JSON) – Security key JSON file can be obtained from Google Console under account credentials.

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

Go to . Click on the dropdown on the left as shown in the image below and a popup will appear on your screen.

Google Analytics Data API (Used to access GA4 report Data)

If you have a question related to this extension please check out our first. If you can't find the answer you are looking for then please contact .

Installation Via Composer
support@scommerce-mage.com
Click here for more information
Click here for more information
support@scommerce-mage.com
Click here for more information
Click here for more information
Click Here
https://console.developers.google.com/
https://developers.google.com/analytics/devguides/reporting/data/v1?hl=en_US
FAQ Section
support@scommerce-mage.com
Installation
Configuration Settings for Google Analytics Synchronization
Verify/Test Synced Transactions
Order Tracking Information
Create Project in Google Developer Console for GA Reporting API
Getting View ID
Getting Property ID
Command to run the Synch Manually