1. Success center
  2. FAQ & Troubleshooting

Trendemon and GA4

Trendemon events can be tracked and viewed inside Google Analytics. The purpose of this article is to help you set up tracking for Trendemon events in the latest version of Google Analytics - GA 4.


On units impressions or units click/submit Trendemon saves events in the dataLayer.


dataLayer - is a JavaScript array,  where website developers or various tools can store data. Google Tag Manager reads that information and uses it in its triggers and variables, also it can send this data to different tools like Google Analytics, Google Ads etc.


The dataLayer is automatically created when you place the GTM code snippet on your website’s source code.

On unit impression Trendemon saves an event called “trendemon_load” and on unit click/submission Trendemon saves an event called “trendemon_click”. Also as a parameter, Trendemon saves the Name of the Unit that was shown or clicked.

Here is the explanation of how to send events when Trendemon units are shown or clicked, to your Google Analytics: 

Let’s start with the Trendemon click event,

  1. Create new tag, choose the type: Google Analytics: GA4 Event

 

In the Configuration Tag field choose your GA4 configuration that you have created before in GTM

In the event name put the name you want to see in Google Analytics, we suggest also calling it trendemon_click

Trendemon also saves in the dataLayer the name of the unit that was clicked, in a variable called unitName. So in the Event Parameters in Parameter Name write “unitName” in the Value Field click on “+” button

Since each time the unit name will be different we need to create a variable for it.

 

Choose the type “Data Layer Variable”

 

In the Data Layer Variable Name write “unitName”

 

Here is how everything should look

 

Now we need to add a trigger (when this tag will fire and send data to GA), Actually we need to fire the tag exactly at the same time when Trendemon adds this variable to the dataLayer.

 

Scroll down to the “Triggering” section, create a new trigger by clicking on “+”, and choose type “Custom Event”

 

Event name - trendemon_click (this is the name of the event that is stored in dataLayer)

 

That's all, now you successfully configured the trendemon_click event.

 

Let’s configure the trendemon_load event:

  1. Create a new tag with the type GA4 Event.
  2. Choose the configuration tag.
  3. Choose the name - we suggest trendemon_load
  4. Add the parameter unitName, in the value choose unit name variable that you created before
  5. Add trigger: type - Custom Event, Event name - trendemon_load

 

 

The second tag is ready:

After you publish the tags you will see these events in your GA4 account.

Tracking Google Analytics Events Using gtag

Copying GA 4 code from the Google Analytics dashboard, and pasting it inside the webpage HTML code. 

Here’s an example of how this code looks like:

pic 1

If you insert GA 4 code as described above, you don’t need to take any further actions - Trendemon events will be tracked automatically and displayed on your Google Analytics dashboard.