Reputation: 71
This is my current code:
function pageViewGa(pagePath, pageUrl, host) {
gtag("event", "page_view", {
"page_title": pagePath,
"page_location": pageUrl,
"page_path": pagePath
});
}
I send pageViewGa()
on each page with the variables appended.
Can I know how I can have the hostname shown in Google Analytics too?
Upvotes: 5
Views: 1221
Reputation: 3360
This website explains many methods of how to show the Hostname in Google Analytics 4 (GA4) without modifying anything in the script:
https://www.vakulski-group.com/blog/post/how-to-use-a-hostname-filter-in-ga4/
Basically this are the methods mentioned:
Upvotes: 0