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 Reply To: How to track user engagement and page views for articles written by our writer using custom dimensions in GA4

  • 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!