Google Analytics 4

Universal Analytics, which is currently implemented on Swift, will be deprecated by July 1st 2023. From that day on it will no longer collect or process any data. Therefore Swift now supports Google Analytics 4. The features of Google Analytics 4 do require the customers and visitors to accept cookies to create usable results. We also support a Debug Mode that allows you to run tests and see events without affecting the real data. To make Debug Mode work properly you will need to log in in DW backend before doing the tests in frontend.

If needed we have made several links throughout this article to Google analytics own documentation.


Before using Google analytics 4 and the Debug Mode you need to do a few changes in the DW backend. These should be done in the website settings.

  1. Click on the three vertical dots next to your website name
  2. Click on Websites in the dropdown
  3. Right click on the website you want to enter the settings of. In the dropdown, click on Edit
Figure 2.1 Navigating to the website settings

Due to GDPR the use of Tracking ID will be deprecated. Instead you should use Measurement ID.

Scroll to the bottom of the website settings page.

  1. In the Google Analytics section add the Measurement ID
  2. Enable the Debug Mode


We have made a table of Google analytics 4 events that are supported in Swift. If you should need more documentation about the events, we have linked to the articles of each event. You can access this by clicking the event names in the table below.  

List of events
Event name Description
view_item_list This event is used when the user has been presented with a list of items of a certain category.
view_item This event signifies that some content has been shown to the user. This event could be used to discover the most popular items viewed.
select_item This event will signify that an item was selected from a list.
add_to_cart This event signifies that an item was added to the cart and is ready for purchase. 
add_to_wishlist This event signifies that an item has been added to a wishlist. In Swift this would be when customers add products to the favorites list
remove_from_cart This event signifies when items are removed from a cart
view_cart This event signifies that a user viewed their cart
begin_checkout This event signifies that a user has begun the checkout process
add_payment_info This event signifies that a user has submitted their payment information
add_shipping_info This event signifies that a user has submitted their shipping information
purchase This event signifies that a user has purchased on or more items