Learn business growth with Google Analytics 4 Forums Google Analytics 4 Creating a GA4 event using Event Builder for image loading

  • Creating a GA4 event using Event Builder for image loading

    Posted by Leo on 6 March 2023 at 2:04 am

    “Hey folks! I’ve got a tricky situation here. We have this job application site where applicants are redirected to another platform to fill out their applications. In my old setup, I was able to keep track of submitted applications by triggering a pageview when an image tag loaded on the confirmation page.

    To give you a picture, this is what my tag looked like:

     <img border="0" height="1" src="https://www.google-analytics.com/collect?v=1&amp;t=pageview&amp;tid=UA-XXXXXXX-3&amp;cid=xxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxx&amp;ec=Forms&amp;ea=Complete%20Application&amp;el=Complete%20Application&amp;dp=%252Fthank-you&amp;dt=Application%20Submitted%20-%20Thanks" width="1" />
    

    I whipped this up with the help of https://ga-dev-tools.google/hit-builder/. But now, GA4 has put me in a soup. It’s moved to this new thing called Event Builder https://ga-dev-tools.google/ga4/event-builder/ and I’m kinda lost. Looks like it uses json format and I’ve no idea how to turn that into a url format.

    Is there anyone who can show me the ropes? All tips are welcome!”

    Liam replied 1 year ago 3 Members · 2 Replies
  • 2 Replies
  • Isabella

    Member
    11 March 2023 at 7:51 am

    Sure, I can help clarify this for you. The Event Builder in Google Analytics 4 (GA4) is a more enhanced tool to help you keep track of events on your website – such as a job application being submitted. However, just like the hit builder tool, it creates a URL embedded inside a script tag, not as an image tag. This is because in GA4, tracking is event-based as opposed to page views in the previous version. When a job form is submitted, it triggers an event and related data is sent to GA4.

    However, if the application site is not yours and you only have the ability to influence it by adding an image tag, you might hit a roadblock with GA4. You might need to come up with other tactics, possibly working more collaboratively with the other platform to track events or continue using the older version of Google Analytics, if possible. Please consult with a web developer for potential solutions that fit your situation best.

  • Liam

    Member
    14 May 2023 at 11:37 am

    Yes! To use Google Analytics 4 (GA4) Event Builder, you’ll be dealing with a different setup and format. The Event Builder for GA4 essentially generates a JavaScript command using the gtag.js library, which is different from the image pixel tracking method you were using in the older version of Google Analytics.

    Here’s an example of the JavaScript command for tracking a generic event:

    gtag(‘config’, ‘GA_MEASUREMENT_ID’, {
    ‘event_name’: ‘my_event’,
    ‘event_params’: {
    ‘parameter_1’: ‘value_1’,
    ‘parameter_2’: ‘value_2’
    }
    });

    In this command, ‘my_event’ is your event name, and ‘parameter_1’ and ‘parameter_2’ are parameters you want to add with the values ‘value_1’ and ‘value_2’ respectively. You typically add these using the GA4 interface and they can be any parameters that are relevant to the event you are tracking.

    If you’re attempting to track a conversion event similar to the ‘Always send’ event in Universal Analytics, you’d replace ‘my_event’ with ‘conversion’ and the parameters would be ‘send_to’ with your ‘GA_MEASUREMENT_ID’ in the format ‘GA_MEASUREMENT_ID/conversion’.

    It’s important to remember that in GA4, you’ll need to implement this JavaScript command on your confirmation page, different from the previous method where an image tag was embedded. This might require adding it to your page’s HTML or via Google Tag Manager, depending on your set up. Lastly, make sure to test the event to ensure it’s properly tracked in your GA4 interface.

Log in to reply.