Configuring the Transaction server
To complete the integration between a React Store and Google Tag Manager, you must add the required parameters to the Transaction server.
Obtaining the Google Tag Manager container parameters
- Go to Google Tag Manager.
- Select the container and go to Admin tab > Environments.
- Click Actions > Get Snippet for live option.
- Copy the gtm_auth and gtm_preview values.
Sample SQL statements to add the OAuth Client ID configured through the Google API console
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (0, 'google.analytics.client.id', <YOUR CLIENT ID FROM GOOGLE API CONSOLE>, 0);
Sample SQL statements to configure the Transaction server for the B2C Emerald store
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (11, 'google.analytics.service.account.view.id',<YOUR VIEW ID FROM THE GOOGLE ANALYTICS EMERALD STORE PROPERTY>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (11, 'google.tag.manager.container.id', <YOUR EMERALD STORE CONTAINER ID FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (11, 'google.tag.manager.auth', <YOUR EMERALD STORE AUTH VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (11, 'google.tag.manager.preview',<YOUR EMERALD STORE PREVIEW VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
Specify the Google Analytics version. You can specify the version as UA, GA4 or both.
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (11, 'google.analytics.versions', 'UA,GA4', 0);
EmeraldMP
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (31, 'google.analytics.property.ga4', <YOUR GA4 PROPERTY ID FOR EMERALDMP>, 0);
Sample SQL statements to configure the Transaction server for the B2C Emerald/EmeraldMP store
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (11, 'google.analytics.service.account.view.id',<YOUR VIEW ID FROM THE GOOGLE ANALYTICS EMERALD STORE PROPERTY>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (11, 'google.tag.manager.container.id', <YOUR EMERALD STORE CONTAINER ID FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (11, 'google.tag.manager.auth', <YOUR EMERALD STORE AUTH VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (11, 'google.tag.manager.preview',<YOUR EMERALD STORE PREVIEW VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
Sample SQL statements to configure the Transaction server for the B2B Sapphire store
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (12, 'google.analytics.service.account.view.id', <YOUR VIEW ID FROM THE GOOGLE ANALYTICS SAPPHIRE STORE PROPERTY>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (12, 'google.tag.manager.container.id',<YOUR SAPPHIRE STORE CONTAINER ID FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (12, 'google.tag.manager.auth', <YOUR SAPPHIRE STORE AUTH VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (12, 'google.tag.manager.preview', <YOUR SAPPHIRE STORE PREVIEW VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
Specify the Google Analytics version. You can specify the version as UA, GA4 or both.
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (12, 'google.analytics.versions', 'UA,GA4', 0);
SapphireMP
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (32, 'google.analytics.property.ga4', <YOUR GA4 PROPERTY ID FOR SAPPHIREMP>, 0);
Sample SQL statements to configure the Transaction server for the B2B Sapphire/SapphireMP store
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (12, 'google.analytics.service.account.view.id', <YOUR VIEW ID FROM THE GOOGLE ANALYTICS SAPPHIRE STORE PROPERTY>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (12, 'google.tag.manager.container.id',<YOUR SAPPHIRE STORE CONTAINER ID FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (12, 'google.tag.manager.auth', <YOUR SAPPHIRE STORE AUTH VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (12, 'google.tag.manager.preview', <YOUR SAPPHIRE STORE PREVIEW VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
Ruby
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (41, 'google.analytics.versions', 'GA4', 0)
Sample SQL statements to configure the Transaction server for the Ruby store
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (41, 'google.tag.manager.container.id', <YOUR RUBY STORE CONTAINER ID FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (41, 'google.tag.manager.auth',<YOUR RUBY STORE AUTH VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (41, 'google.tag.manager.preview', <YOUR RUBY STORE PREVIEW VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (41, 'google.analytics.property.ga4', <YOUR GA4 PROPERTY ID FOR RUBY>, 0);
Ruby B2B Store
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (42, 'google.analytics.versions', 'GA4', 0);
Sample SQL statements to configure the Transaction server for the B2B Ruby store
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (42, 'google.tag.manager.container.id',<YOUR RUBY STORE CONTAINER ID FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (42, 'google.tag.manager.auth',<YOUR RUBY STORE AUTH VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (42, 'google.tag.manager.preview', <YOUR RUBY STORE PREVIEW VALUE FROM THE GOOGLE TAG MANAGER CONFIGURATION>, 0);
INSERT INTO STORECONF (STOREENT_ID, NAME, VALUE, OPTCOUNTER) VALUES (42, 'google.analytics.property.ga4', <YOUR GA4 PROPERTY ID FOR RUBY>, 0);
Database configurations for Management Center to connect to Google Analytics
Configuration | Table in Database | Parameter name | Description and Value |
---|---|---|---|
Service account: Allowed scopes. Used by the Transaction server to generate an access token. |
STORECONF | google.analytics.service.account.scopes | The OAuth allowed scopes that this Google Service Account is
allowed to access. https://developers.google.com/identity/protocols/oauth2/scopes#analyticsreporting or |
OAuth Client ID Used by Management Center to connect to Google Analytics |
STORECONF | google.analytics.client.id | The OAuth client ID configured through the Google API
console. This is required for HCL Commerce to authenticate with Google and authorize with Google Analytics. |
Service Account - View ID | STORECONF | google.analytics.service.account.view.id | For example - 226858278. |
The property ID for the GA4 account |
STORECONF | google.analytics.property.ga4 | For example - 263926965. |
Database configuration for React Store to connect to Google Tag Manager
Table in Database | STOREENT_ID | Parameter name | Value |
---|---|---|---|
STORECONF | 11 | google.tag.manager.container.id | LFR-KJED23K |
STORECONF | 11 | google.tag.manager.auth | Osdfs78hk3dsfo8kKE |
STORECONF | 11 | google.tag.manager.preview | Serv-2 |
STORECONF | 12 | google.tag.manager.container.id | Your Sapphire store Container ID from the Google Tag Manager configuration. |
STORECONF | 12 | google.tag.manager.auth | Your Sapphire store Auth value from the Google Tag Manager configuration. |
STORECONF | 12 | google.tag.manager.preview | Your Sapphire store preview value from the Google Tag Manager configuration. |
STORECONF | 41 | google.tag.manager.container.id | GTM-KHSCNPNZ |
STORECONF | 41 | google.tag.manager.auth | _WkSmERf8gYhBxZMoQKIQQ |
STORECONF | 41 | google.tag.manager.preview | env-1 |
STORECONF | 42 | google.tag.manager.container.id | GTM-THZ55JNP |
STORECONF | 42 | google.tag.manager.auth | n0AokPyKCkpPEjvzNQACEg |
STORECONF | 42 | google.tag.manager.preview | env-1 |