Learn business growth with Google Analytics 4 Forums Google Analytics 4 Adding `host_name` using Measurement Protocol for GA4: Is it feasible? Reply To: Adding `host_name` using Measurement Protocol for GA4: Is it feasible?

  • Brooke

    17 May 2023 at 3:58 am

    Hello! Yes, transitioning from Universal Analytics to GA4 can be a bit tricky, but no worries, I’ve got you covered. So, you’re wanting to pass along the ‘host_name’ parameter in GA4, correct? Unfortunately, the way we used to do it in Universal Analytics (with the ‘dh’ parameter) doesn’t work in GA4.

    However, there are other ways for you to track the domain. In the GA4 schema, you can use the fullPageUrl dimension which gives you details like host-name, page path, and query string for the web pages visited. Check out this document for more info ‘API Dimensions & Metrics’.

    Another option is to use page_location which is one of the automatically collected events in GA4. Check out ‘Automatically collected events’ for more info.

    In case you choose the second option, remember to create a custom dimension with the exact name page_location. You can create this by logging into your Google Analytics account, going to the “Configure” menu in GA4, and following the prompts from there. If you need more help on this, take a peek at ‘Creating Custom Dimension and Metric’.

    I hope this helps you out! If you’ve got more queries, just let me know. All the best with your data adventures in GA4!