<script async src="https://www.googletagmanager.com/gtag/js?id=<%= ::OstConfig.google_analytics_4_measurement_id %>"></script>
<script>
    window.dataLayer = window.dataLayer || []
    function gtag() { dataLayer.push(arguments) }

    window.gtag("js", new Date())

    const trackGoogleAnalytics = (event) => {
        window.gtag("config", "<%= ::OstConfig.google_analytics_4_measurement_id %>", {
            "cookie_flags": "max-age=7200;secure;samesite=none"
        })
    }

    document.addEventListener("turbo:load", trackGoogleAnalytics)
</script>

<script async src="https://www.googletagmanager.com/gtag/js?id=<%= ::OstConfig.google_analytics_4_measurement_id %>"></script>
<script>
    window.dataLayer = window.dataLayer || []
    function gtag() { dataLayer.push(arguments) }

    window.gtag("js", new Date())

    const trackGoogleAnalytics = (event) => {
        window.gtag("config", "<%= ::OstConfig.google_analytics_4_measurement_id %>", {
            cookie_flags: "max-age=7200;secure;samesite=none",
            page_location: event.detail.url,
        })
    }

    document.addEventListener("turbo:load", trackGoogleAnalytics)
</script>

Add page location to gtag config
Add page location to gtag config
