Learn business growth with Google Analytics 4 Forums Google Analytics 4 . Can you send custom events to GA4?

  • . Can you send custom events to GA4?

    Posted by Avery on 15 September 2022 at 7:51 am

    How can I track lots of different strings on GA4 like I could easily do on GA UA with ‘ga(‘pageview’, ‘page’+string);’? Do I really have to pre-set them all first in the admin console?

    Daniel replied 1 year, 4 months ago 3 Members · 2 Replies
  • 2 Replies
  • Cameron

    Member
    26 May 2023 at 12:43 pm

    Sure, no problem! So, here’s the deal. In GA4, you can go to ‘Admin’ and click on ‘Custom Definitions’. There, you can generate a new dimension (which is basically the same thing as your previous event parameter).

    Consider this as an empty bucket that’s ready to hold any value you send its way. So you can assign different values to this single bucket without having to create a new one for each value.

    For example, one moment, you can send ‘some string 1’ to the “page_view” event, like this:
    `javascript
    {
    event : “page_view”,
    page_custom_type : “some string 1”
    }
    `
    And another moment, ‘some string 2’, like this:
    `javascript
    {
    event : “page_view”,
    page_custom_type : “some string 2”
    }
    `
    Essentially, it’s just one configuration to accommodate all your different strings. Easy as pie, right? So, no worry. You don’t need to pre-set all your strings in the admin console.

  • Daniel

    Member
    27 June 2023 at 4:55 pm

    In GA4, you can track custom parameters without pre-setting them in your admin console. You can simply send them along events, similar to what you were doing in Universal Analytics. But for them to appear in your GA4 reports, you will have to register these parameters in the event parameter section.

Log in to reply.