Learn business growth with Google Analytics 4 Forums Google Analytics 4 How to track user engagement and page views for articles written by our writer using custom dimensions in GA4

  • How to track user engagement and page views for articles written by our writer using custom dimensions in GA4

    Posted by Jaspreet on 16 November 2022 at 7:10 pm

    Hey there! I’m hoping to pluck some data out of GA4, specifically related to the “Editor name” and “Published date.” You can get a better idea of what I’m hunting for in the screenshot I’ve attached here – give it a peek.

    I’m new to GTM, so if you could give me a beginner’s step-by-step guide to accomplish this, that’d be a lifesaver!

    Just as a reference, there’s a screenshot of the current details we’re pulling from UAGA – but, our goal is to replicate this in GA4. Any help would be super appreciated.

    Oh, and the site we’re dealing with here is a Hindi news portal called dailynews360.

    I’ve taken a few swings at it myself, but haven’t been able to hit a home run just yet. Here’s a shot of what I’ve tried – [creating custom dimensions](https://i.stack.imgur.com/eG7wx.jpg) and adding some parameters in the GA4 script. But unfortunately, I’m still seeing that the data is not available – check it out.

    If you want to know the kind of report I’m trying to generate, just take a look at this attached screenshot –it’ll give you an idea.

    George replied 1 year, 3 months ago 3 Members · 2 Replies
  • 2 Replies
  • Bailey

    Member
    9 February 2023 at 9:02 pm

    Hey there! It looks like you’re trying to track “page_view” with some extra event parameter, right? Don’t worry, it’s not as complicated as it might seem. You just need to make a couple of small adjustments to your GA4 script for your site, dailynews360. Here’s how you can get this sorted:

    1. Firstly, we need to pause automatic page view tracking. Add the following code to your script to handle that:
    gtag('set', 'send_page_view', false);
    
    1. Next up, let’s start manually tracking the page view. This way, we can include the “Editor’s name” and “Publication Date” parameters. Include the code snippet below in your script:
    gtag('event', 'page_view', {
      editor_name: $your_editor_name,
      pub_date: $your_publish_date
    });
    

    Once you’ve made these changes, you should be good to go. Check your event parameters to see if everything is showing up as expected. With a little tweaking, you should be able to generate the exact kind of report you’re after. Best of luck!

  • George

    Member
    17 April 2023 at 10:56 pm

    To extract the specifics data such as the “Editor name” and the “Published Date” from GA4, you’ll want to use Google Tag Manager (GTM) in tandem with GA4. The first step is to create user-defined variables in GTM to capture these specific elements. You’ll likely need to use JavaScript or jQuery selectors to capture these data points from your site. Once you’ve implemented the required custom JavaScript variable, run a test to be sure you’re pulling the correct data.

    Once these variables are in place, you’ll next need to configure your GA4 settings. In addition to the standard data sent by GTM to GA4, you’ll want to add a new parameter. The Parameter Name should match the key you want in GA4 (e.g., “editor_name”), and the value should correspond to your newly created GTM variable (e.g., {{Editor Name}}).

    However, you’ll also have to configure GA4 to collect the new data. This involves creating a new custom definition in GA4 that matches the parameters we’re sending over from GTM. Navigate to the GA4 property, then ‘All Events’ -> ‘Manage Custom Definitions’ -> ‘Create Custom Dimensions’. Ensure the Event parameter name matches the parameter you’re sending from GTM, and give it a fitting description and display name.

    After implementation, it might take a while for data to start populating within GA4. Monitor the results, and fine-tune if necessary. Finally, to generate the desired report, you might need to use the explore option in GA4 to display data according to the custom dimensions (editor name and published date). You can then compile the data as per your preference on the GA4 dashboard or your desired data visualization tool.

    Given the complexity and detail of this process, you might consider hiring a GA4/GTM consultant or doing further research if any of the above steps are difficult to follow or not bringing the expected results. Remember to consistently test and validate the data being sent to GA4 to ensure that desired output is achieved. Good luck!

Log in to reply.