Installation
You will require to install MageDelight Base Extension first. If it is not installed then please download it from https://www.magedelight.com/pub/extensions/magedelight-base.zip and unzip the package file into the root folder of your Magento 2 installation.
Before installing the extension, please make sure to Backup your web directory and store database
You will require to install MageDelight Base Extension first. If it is not installed then please download it from https://www.magedelight.com/pub/extensions/magedelight-base.zip and unzip the package file into the root folder of your Magento 2 installation.
Root Directory is - "app/code/magedelight/#YourExtensionName#"
- Unzip the extension package file into the root folder of your Magento 2 installation.
- Connect to SSH console of your server:
- Navigate to the root folder of your Magento 2 setup
Run command as per below sequence,
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:clean
- log out from the backend and log in again
If you are using Magento 2.3 or later then you do not need to activate license. Extension will be activated with silent activation mechanism and does not require activation keys to be entered manually.
Backend Configuration (Admin side)
- Enable: Set "Yes" to enable the GA4 with GTM module.
- Associated Google Account: Enter your Google email to identify the associated GA4 account.
- GA4 API Keys: Enter the AI key that you generated from the Google Analytics 4 Panel
- Cookie Consent Based Tracking: Enable/disable GA4 tracking for customers.
- Strict Domain Tracking: Option to enable/disable strict domain tracking.
- Domain: You can add the domain name for the Ga4 tracking.
- GTM JavaScript Head Code: Provide GTM JavaScript Code here with your unique GTM tracking ID.
- GTM Non-JS Body Code: Provide GTM Non-Javascript Code here with your unique GTM tracking ID.
- Account ID: Provide the Google Tag Manager (GTM) Account ID associated with your setup.
- Container ID: Provide the GTM Container ID for the specific container you wish to use.
- Measurement ID: Provide the Google Analytics 4 (GA4) Measurement ID to link your data stream.
- Export Triggers and Tags: Click on "Generate" button to get the JSON file for the GTM.
- Promotion Tracking: Set to "Yes" to enable promotion tracking in GA4.
- Event List: Select the event from the provided list that you wish to track for the promotional event.
Product Identifier: Select either SKU or ID to share with Google Analytics; SKU shares the Magento Product SKU, while ID shares the Magento Product ID.
- Currency: Choose between Base Currency or Store Currency for GA4; Base Currency shares the store's base currency (e.g., USD), while Store Currency shares the store's currency (e.g., GBP). For multi-currency setups, the GA4 panel configuration.
- Enable Brand:
- Enable Product Variant:
- Child vs Parent:
- Checkout Success Page Path:
- Order Total Calculation:
- Exclude Tax From Transaction:
- Exclude Shipping From Transaction:
- Account ID: Provide GTM Account ID.
- Account ID: Provide GTM Account ID.
- Product Identifier: Select Product Identifier as either SKU or ID to share with Google Analytics.
- SKU - Magento Product SKU will be shared with GA4 APIs
- ID - Magento Product ID will be shared with GA4 APIs
- Currency: Select currency as either Base Currency or Store Currency to share with Google Analytics.
- Base Currency: Magento Store's Base Currency will be shared with GA4 APIs
- Store Currency: Magento Store's Store Currency will be shared with GA4 APIs
- Example:
- Magento Store Base Currency is USD, and Store Currency is GBP. If your GA4 Panel shows USD currency, then select Base Currency, but if your GA4 Panel is configured to show data in GBP, then select Store Currency in MageDelight GA4 currency configurations. We assume that you have multi-currency enabled in Magento as USD and GBP (Store View).
- Enable Brand: Select "Yes" to enable the brand. It will share values as Brands with GA4 APIs.
- Brand Attribute: Provide Magento Attribute to share values with Google Analytics as Brands. I.e., Magento Product Attribute "brand" can be set as GA4 brand.
- Enable Product Variant: Select "Yes" to enable the product variants to be shared with GA4 APIs.
- Child vs Parent: If Child shared, then Child Products information will be shared with GA4 APIs else, Parent Products information will be shared with GA4 APIs. It will be helpful with Magento configurable products. I.e., Parent SKU "MT11" and child SKU "MT11-S-Blue" is set in Magento. For Parents, it will share MT11, but for child SKU, it will share "MT11-S-Blue" with GA4.
- Checkout Success Path: Please provide webpage URL of checkout success. I.e., "checkout/onepage/success".
- Order Total Calculation: Provide the order total either as the value of Magento Subtotal or Magento Grand Total.
- Exclude Tax From Transaction: Select "Yes" if you want to exclude tax from the transaction amount.
- Exclude Shipping From Transaction: Select "Yes" if you want to exclude shipping from the transaction amount.
- Persistent data layer expiry time: Provide values in minutes to persist (cookie) data layer.
- Use Secure Cookies: Set "Yes" to share the cookie as a secure cookie. Your website must be with HTTPS to use secure cookies.
- Is Allow Not Logged In customer: Set "Yes" to allow secure cookie for not logged in customers.
- Provide "Public ID" (it can be found in your GTM account) to generate tags, triggers, and variables for GA4. It will be helpful to import the same to Google Analytics Panel.
Backend Functionality
Realtime Tracking Logs
MageDelight >> GA4 with GTM >> Reports >> Realtime Tracking Logs
- Realtime Data in JSON format can be viewed in the admin panel.
Purchase
Click here to purchase from MageDelight.
Click here to purchase from Magento Marketplace. (Composer installation supported)
Thank you for choosing MageDelight!