Note

In most of cases, if you don’t know what an option is for, you can leave the default settings.

Configuration

General Configuration

_images/googleanalytics4-magento-config-1-general.png

Here are few steps to start with our extension:

Activate the extension.

Then, fill the Google Analytics 4 ID, it starts by « G- » and you can find it in your GA4 account.

Then, fill the API Secret, it starts by « G- ». To create or retrieve your secret, navigate to your GA4 account: Admin > Data Streams > choose your stream > Measurement Protocol > Create

If you have multiple stores, you can configure different IDs in the different store views scope. You can also set a global UA property if you enable the option « Add a global tracker » and fill the Google Analytics ID of your global account.

You can enable the queue. If will store the events in database and send them asynchronously.

Google Tag Manager

_images/googleanalytics4-magento-config-2-gtm.png

This is optionnal. If you don’t want to use GTM, just leave it disabled.

Else, you should enable Google Tag Manager (note that Analytics part should be enable too, and the GA4 ID & API Secret filled ! It will be used for server-side events).

Then you can - or not - add the GTM container tag. If you have already setted up GTM manually or via another extension, then you can let this option off. In the other case, you should enable it, and fill the GTM Container ID (You got that ID by creating a container in GTM).

To see how to configure Google Tag Manager, see gtm.

Google Analytics Options

Note

Change this options only if you are an expert. Default settings fit usually well.

_images/googleanalytics4-magento-config-3-ga-options.png

Ecommerce

_images/googleanalytics4-magento-config-4-ecommerce.png

Google Measurement Protocol allows to send hits to GA4 on server side (no JavaScript).

If Use Google Measurement Protocol is set on No, the transaction will be sent on checkout success page via gtag.js

If the first parameter is set on Yes, the transaction will be sent on server side, triggered by an event such as invoice creation, order creation, order status change and other advanced events.

Use Store Currency

If set on « Yes », store currency is sent to GA4.

If set on « No », base currency is sent to GA4.

It is recommend to choose the base currency, else GA4 will convert itself when the hit is received, which could lead to amount’s differences.

Custom Dimension

Based on your needs, you can enable or not those properties, it will be sent with your events :

_images/googleanalytics4-magento-config-6-custom-dimension-metrics-1-env.png _images/googleanalytics4-magento-config-6-custom-dimension-metrics-2-breadcrumb.png _images/googleanalytics4-magento-config-6-custom-dimension-metrics-3-customer.png _images/googleanalytics4-magento-config-6-custom-dimension-metrics-4-product.png _images/googleanalytics4-magento-config-6-custom-dimension-metrics-5-cart.png

Events

Based on your needs, you can enable or not those events:

_images/googleanalytics4-magento-config-7-events.png

Extra Pageviews

Like events, you can choose depending on your needs.

It can help you in many ways. For example, you can use them to create conversions.

_images/googleanalytics4-magento-config-8-pageviews.png

Custom Tags

Tags in JavaScript. Use only if you are an expert.

_images/googleanalytics4-magento-config-9-custom-tags.png

Google Adwords

ID provided by Google Adwords.

_images/googleanalytics4-magento-config-10-adwords.png

Google Remarketing

ID provided by Google Remarketing.

_images/googleanalytics4-magento-config-11-remarketing.png

Tools

_images/googleanalytics4-magento-config-12-tools.png

Here you can choose to activate or not the logs for Measurement Protocol. it is only for debugging. Do not use in production environnement or temporarly.