1. Home
  2. Custom Scripts & Codes
  3. Tracking with Google Analytics – Configuring Tag Manager manually

Tracking with Google Analytics – Configuring Tag Manager manually

Note: We do not recommend this option due to its complexity. Click here to learn how to use our template option, which makes this process significantly easier, or here to learn about other options.

If you do not want to use our container as a starter, Google Tag Manager can be configured manually. To do this, you will be adding variables, tags, and triggers.

Set up Google Analytics 4 account

  1. Create a new Google Analytics 4 property.
  2. Use the GA4 Setup Assistant to automatically create a new GA4 property and copy the following settings from your Universal Analytics property: property name, website URL, timezone, and currency settings.
  3. Uncheck the ‘Enable data collection using your existing tags’ option to disable the connected site tag feature. Alternatively, if you don’t want to copy any settings from your Universal Analytics property create a Google Analytics 4 property without the GA4 Setup Assistant.

Set up GTM and add the GA4 and Purchase Event tags

Connect GA4 Analytics Measurement ID to your GTM ID

  1. Open the Google Tag Manager container for your existing Universal Analytics implementation
  2. Click Tags > New
  3. Click Tag Configuration and select Google Analytics: GA4 Configuration
  4. Enter the tag ID of your Google Analytics 4 property in the Measurement ID field
  5. Select to trigger the tag on All Pages
  6. Give your Tag Configuration a Name (example: GA4 Configuration)
  7. Save and publish your tag configuration

Configure GA4 to track the E-commerce ‘purchase’ event and collect the Data Layer parameters

  1. Click Tags > New
  2. Click Tag Configuration and select Google Analytics: GA4 Event
  3. Set the Configuration Tag Field and select the name of your GA4 Analytics Tag name that you created in the previous setup (GA4 Configuration)
  4. Set the Event Name as purchaseimportant: this must be lowercase
  5. Set up each of the Event Parameters to pass to GA4 during the purchase – the available parameters are: transaction_id, items, value ,currency, tax, shipping

    For example to set up the transaction_id :
    1. Enter in the Parameter name: transaction_id
    2. Enter in the Value by clicking on the plus button
    3. On the ‘Choose a variable’ screen, click the plus icon in the upper right hand corner
    4. This will open the Variable Configuration window
    5. Click to choose a Variable Type and choose Data Layer Variable
    6. Add the Data layer Variable Name: ecommerce.transaction_id
    7. Make sure to enter a name in the upper left (example: Ecommerce Transaction ID), and click Save

Repeat this process by adding the rest of the purchase event parameters that you want to track. The parameters available are listed below:

  1. items
    1. Parameter Name: items
    2. Set the Data Layer Variable Name to ecommerce.items
    3. Name the Variable Configuration: Ecommerce Items
  2. value
    1. Parameter Name: value
    2. Set the Data Layer Variable Name to ecommerce.value
    3. Name the Variable Configuration: Ecommerce Value
  3. currency
    1. Parameter Name: currency
    2. Set the Data Layer Variable Name to ecommerce.currency
    3. Name the Variable Configuration: Ecommerce Currency
  4. tax
    1. Parameter Name: tax
    2. Set the Data Layer Variable Name to ecommerce.tax
    3. Name the Variable Configuration: Ecommerce Tax
  5. shipping
    1. Parameter Name: shipping
    2. Set the Data Layer Variable Name to ecommerce.shipping
    3. Name the Variable Configuration: Ecommerce Shipping
  6. After you have entered in all of these parameters, you will see them on the ‘Choose a Variable’ screen
  7. Close out of this screen by clicking the X in the upper left corner and you will be returned your Tag Configuration page for GA4 Purchase
  8. Scroll down to the ‘More Settings’ section, click the expand arrow, check the ‘Send ecommerce data’ toggle, and select ‘Data layer’ as the data source

You should now see 2 tags configured:

1. GA4 Configuration – this references your GA4 measurement ID
2. GA4 Purchase – this references the GA4 Purchase event

Add a GTM Trigger to fire the ‘purchase’ event

  1. Click on ‘Triggers’ from the left side menu
  2. Click on the ‘New’ button on the right hand side
  3. Click ‘Choose a trigger type to begin setup…’
  4. Choose ‘Custom Event’ in the popup window
  5. Set the Event name to purchase
  6. Set the option ‘This trigger fires on’ to ‘All Custom Events’
  7. In the upper left corner, rename the trigger to ‘Purchase’, and click Save
  8. Go back to the Tags section from the left hand menu and click on the ‘GA4 Purchase’ Tag that you created previously
  9. Click on the ‘Triggering’ section at the bottom to set up the Trigger just created
  10. In the ‘Choose a trigger’ window, select the ‘purchase’ event trigger that you just created, and click save

Configure GA4 to track the E-commerce ‘view_item’ event and collect the Data Layer parameters

  1. Click Tags > New
  2. Click Tag Configuration and select ‘Google Analytics: GA4 Event’
  3. Click the Configuration Tag Field and select the name of the GA4 Analytics Tag
  4. Set the Event Name: view_item (important: this must be lowercase)
  5. Setup the items Event Parameter to pass to GA4 during the view_item event
  6. Add items in the ‘Parameter Name’ Field
  7. Click the add + button for the ‘Value’ field, and select the ‘Ecommerce Items’ Data Layer Variable that you created before for the purchase event
  8. Scroll down to the ‘More Settings’ section, click the expand arrow, check the ‘Send ecommerce data’ toggle, and select ‘Data layer’ as the data source

Add a GTM Trigger to fire the ‘view_item’ event

  1. Click ‘Triggers’ on the left-hand menu
  2. Click the ‘New’ button on the right hand side, and click ‘Choose a trigger type’
  3. Choose “Custom Event” in the dialogue window
  4. Set the event name to: view_item
  5. Set ‘This trigger fires on’ to ‘All Custom Events’
  6. Set Name the Trigger in the upper left and corner to view_item and click Save
  7. Go back to the Tags section from the left hand menu and click on the ‘GA4 View Item Event’ Tag that you previously created
  8. Click on the ‘Triggering’ section at the bottom, and in the ‘Choose a trigger’ dialog, selec tthe ‘view_item’ event trigger you just created

You will now see your 3 Tags with their Triggers set up and ready to track your GA4 Analytics and your Purchase and View Item events.

Submit and save your new configuration

Make sure to click the “Submit” button in the top right hand side of the page to save your changes. Click this button, add a name for your Workspace, and click the ‘Publish’ button.

Updated on June 14, 2023

Was this article helpful?

Related Articles