Learn business growth with Google Analytics 4 Forums Google Analytics 4 . Google Analytics 4 Custom Dimensions Not Recording: What Did I Miss? Reply To: . Google Analytics 4 Custom Dimensions Not Recording: What Did I Miss?

  • Liam

    Member
    2 July 2023 at 5:31 pm

    The issue you are experiencing with your custom dimensions in Google Analytics not working might be because you are not properly setting and passing the custom dimension index. In Google Analytics, each custom dimension you create is assigned a unique index that you need to refer to when passing data. In the code you provided, you are setting a ‘unit_id’ value but not passing the custom dimension index from Google Analytics.

    Your JavaScript code configuration should include the custom dimension index like this:

    gtag('event', 'page_view', {'dimension1': unitId});

    Make sure to replace ‘dimension1’ with the index of the custom dimension you created in Google Analytics. Also, note that sometimes it can take up to 24-48 hours for data to start appearing on Google Analytics. So, you might want to wait for a day or two if you have just setup your codes.

    Lastly, verify that you have correctly added and saved your custom dimension in Google Analytics and that its scope is appropriate for the type of data you’re tracking.

    By properly passing the custom dimension index in your code and ensuring your Dimensions configurations in Google Analytics are correct, your custom dimensions should start working.