Saturday, 11 February 2023

What are the consequences of dispatching "different" events under a same name through Google Tag Manager onto the Google Analytics 4?

Suppose there are a lot of buttons on a website that are categorized in three sets of A, B, and C. The buttons on each set, push a corresponding custom button_click event to the dataLayer, independently. As indicated below, the "data" include some "columns" (i.e: identically named fields like button, size, etc. as denoted below). It's all fine and regular so far.

Consider, however, that each set has a different use case, so each of them would have a few non-uniform properties, as shown below:

dataLayer.push({event: "button_click", button: "b1", size: "L", ...,       service_id:     1,  name: "John" }); // A
dataLayer.push({event: "button_click", button: "b2", size: "S", ...,         language:  "en",  term: "Long" }); // B
dataLayer.push({event: "button_click", button: "b3", size: "M", ...,            color: "red",  item: "Shoe" }); // C
//              ^^^^^^^^^^^^^^^^^^^^^  ^^^^^^        ^^^^       ^^^        ^^^^^^^^^^          ^^^^
//              Same Event Name        |Identically Named Columns |        |Non-uniform Properties|

Technically, dispatching "different" events under a same name of button_click. So, as the first question:

  1. What would be the issues with the aforementioned practice in respect to the Google Analytics4? What will be the consequences, or what may go wrong?

In the real case scenario, there are more than three sets. Also, there are a lot of these "common columns", and only a few "non-uniform" ones. They all should be entered manually into the Google Tag Manager (GTM). It's obviously cumbersome and irrational; thus, I wonder...

  1. Is there a way in GTM to somehow group these "common fields" in a package, to avoid repeatedly entering the same records for each and every class of events, over and over again?!

In an attempt to workaround the aforementioned question, I couldn't utilize the GA4 Configuration Tag to pack all the "common fields" inside of it, and utilize its so called "inheritance" feature. Furthermore I've also encountered with the issue of "Persistent Values"!

Please shed some light on the matters.



from What are the consequences of dispatching "different" events under a same name through Google Tag Manager onto the Google Analytics 4?

No comments:

Post a Comment