\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
\n"}
\ No newline at end of file
diff --git a/tests/e2e/utils/track-event.js b/tests/e2e/utils/track-event.js
new file mode 100644
index 00000000..1167b7f5
--- /dev/null
+++ b/tests/e2e/utils/track-event.js
@@ -0,0 +1,111 @@
+/**
+ * Tracking of Gtag events.
+ *
+ * @typedef { import( '@playwright/test' ).Request } Request
+ * @typedef { import( '@playwright/test' ).Page } Page
+ */
+
+/**
+ * Returns the data for a specific event from a set of multiple events seperated by newlines.
+ *
+ * @param {string} data All event data combined.
+ * @param {string} eventName Event name to match.
+ *
+ * @return {Object} Single event data.
+ */
+function parseMultipleEvents( data, eventName ) {
+ const events = data.split( '\r\n' ).map( ( eventData ) => {
+ return Object.fromEntries( new URLSearchParams( eventData ).entries() );
+ } );
+
+ return events.find( ( e ) => e.en === eventName );
+}
+
+/**
+ * Splits the product data using the ~ seperator and uses the first 2 characters as the key.
+ *
+ * @param {string} data
+ * @return {Object} Product data split into key value pairs.
+ */
+function splitProductData( data ) {
+ return Object.fromEntries(
+ data.split( '~' ).map( ( pair ) => {
+ return [ pair.slice( 0, 2 ), pair.slice( 2 ) ];
+ } )
+ );
+}
+
+/**
+ * Tracks when the Gtag Event request matching a specific name is sent.
+ *
+ * @param {Page} page
+ * @param {string} eventName Event name to match.
+ * @param {string|null} urlPath The starting path to match where the event should be triggered.
+ *
+ * @return {Promise