Solved

Conversion tracking in Google Analytics 4

  • 8 February 2023
  • 8 replies
  • 170 views

Badge

Hi all, 

Have integrated GA4 into UB using GTM… all works fine. 

Looking to set up events for Conversion tracking into both GA4 and GAW…

 

From what I read, UB doesnt officially support GA4 yet, and the advice for GA4 is to use GTM to deploy, which I have done - but how do we pass conversions into GA4, form submits etc?

GA4 Conversion setup looks to use Events, so believe it’s a case of creating or passing the event names etc?

icon

Best answer by Oliver_Lord 14 February 2023, 10:58

View original

8 replies

Userlevel 4
Badge

Hi @cy80rg,

 

Thanks for your post here in the Unbounce Community 🖐,

 

Good question re passing events into your GA4 property via GTM. I recently set up a form submission event to test this out. Here’s a short video showing you my setup. I hope this helps :-).

Badge

Thanks Olly, 

 

I’ve got *something* working, not entirely certain it’s correct lol … 

Created the tag and the trigger as per your video. 

I have three forms I’d like to track, i’d like to be able to track then as individual events (and Goals) in GA4. 
Would I need to create indivudial tags for each of the three, or can we pss the Action or Label in to GA4, as I was hoping?

I did try this using the Event Parameters in GTM, but that looks to be hard-coding those vals, rather than firing only on those vals being met in the Event… 

Userlevel 4
Badge

Good question,

Whilst not an expert on all things GA4 yet, would you not be able to differentiate the forms by using the URL locations in Events in my GA4 property? I ran a test on 2 test forms and this is what I found in GA:

GIF Recording 2023-02-16 at 4.33.38 PM - View Image

815bc01b796dd6f1733c957c5af194938c6b347e61fc1b93c81f2e4136007f3ec73cebef342d19caabf6b60eb70fa26afdebb1b91a66c0683e95b22753137c81bd4a4b698e6b9ef2c0dbb129baa78ae8

 

Userlevel 6
Badge +4

As UA is coming to an end I really need to get a handle on how to utilize GA4 for A/B testing on Unbounce. I have been able to set up the native integration and events are tracking in GA4.

However, conversions are not tracking to page variants which is “kinda important”, same with external conversion tracking (e.g. on Shopify)

Does anyone have insight or expertise to share on this topic? In my opinion, we as Unbounce users would be rendered helpless without variant and external tracking in GA4. As you know we need more details than the data we get from Unbounce for proper optimization.

Userlevel 4
Badge +1

Wanted to share the recent updates for variant-specific tracking in GA4 we released. This should be helpful for anyone looking into the options with GA4. 

Our GA4 integration documentation has been updates as well 👍🏻

Userlevel 6
Badge +4

@ cy80rg, I might have a solution. By assigning class to your form, you can fire events to GA4 based on your form’s class. You can either have the forms events include event labels, or you can send unique event names to GA4. It really depends on your preference.

 

Se examples using labels, where forms are assigned classes “form-lead” or “form-content”

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script>
$(document).on('submit', '.form-lead', () =>
gtag('event', 'form_submit', { eventLabel: 'lead' }));
$(document).on('submit', '.form-content', () =>
gtag('event', 'form_submit', { eventLabel: 'content' }));

</script>

 

If you want to pass unique event names, you can simply change that in the above script and yet preserve labels.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script>
$(document).on('submit', '.form-lead', () =>
gtag('event', 'form_submit_lead', { eventLabel: 'lead' }));
$(document).on('submit', '.form-content', () =>
gtag('event', 'form_submit_content', { eventLabel: 'content' }));

</script>

To assign class to your form simply click it in the editor and assign the name like this. Please not that this is using the classic editor, not sure if this can be done in the new builder. Also notice that this only apply to forms place on page level, not popups.

 

Userlevel 4
Badge +1

@Finge thanks for sharing this one! Definitely bookmarking it 👍🏻

I wanted to share Google Analytics 4: The Ultimate Guide for 2024 where you can learn the latest update about Google Analytics 4. Here I have got into every minor detail about Google Analytics 4, so you can go through it and if you have any queries, then reach out to me.

Reply