[英]How to add referral exclusions in Google Analytics 4 (GA4) properties
We have a website which uses a Stripe hosted payment page, so the user is taken to stripe.com for payment and then redirected to our website.我们有一个使用 Stripe 托管支付页面的网站,因此用户被带到 stripe.com 进行支付,然后重定向到我们的网站。 In Universal Analytics we can add 'Referral exclusions' to ignore this in the report so that our referral data is correct.在 Universal Analytics 中,我们可以添加“推荐排除”以在报告中忽略这一点,以便我们的推荐数据正确。 Ie it doesn't start a new session every time someone makes a payment.即,每次有人付款时,它都不会启动新的 session。
https://support.google.com/analytics/answer/2795830?hl=en https://support.google.com/analytics/answer/2795830?hl=en
In our new GA4 property this isn't possible (it's not a feature of GA4).在我们的新 GA4 属性中,这是不可能的(这不是 GA4 的功能)。 And all of our payments from Stripe have an 'ourwebsite.com' referral.我们从 Stripe 支付的所有款项都有一个“ourwebsite.com”推荐。 All the payments in PayPal which stays onsite have the correct referral Email, Ads etc.留在现场的 PayPal 中的所有付款都有正确的推荐 Email、广告等。
After looking at some solutions I have tried to add the following (independently) to the payment success page (after Stripe).在查看了一些解决方案后,我尝试将以下内容(独立)添加到付款成功页面(在 Stripe 之后)。 But neither is working.但两者都不起作用。
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('set', {'page_referrer': null});
AND和
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('set', {'page_referrer': 'https://ourwesbite.com/payment/gateway'});
Any help would be appreciated.任何帮助,将不胜感激。
Looks like Google has rolled out the feature to support this functionality now.看起来谷歌现在已经推出了支持这个功能的功能。
https://support.google.com/analytics/answer/10327750?ck_subscriber_id=750579406 https://support.google.com/analytics/answer/10327750?ck_subscriber_id=750579406
You can either configure unwanted referrals in the GA admin.您可以在 GA 管理员中配置不需要的推荐。
Or you can set ignore_referrer=true for individual events as per this article.或者,您可以根据本文为单个事件设置 ignore_referrer=true。
gtag('config', 'G-XXXXXXX', {
ignore_referrer: 'true'
});
Would adding the stripe domain to the "Configure Your Domains" setting under the Data Streams resolve this?将条带域添加到数据流下的“配置您的域”设置可以解决这个问题吗?
Go to Admin > Data Streams > Select your data stream > More tagging settings > Configure your domains Go 至管理员 > 数据流 > Select 您的数据 stream > 更多标记设置 > 配置您的域
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.