utm_source 和 utm_medium 在 SPA 中丢失 [英] utm_source and utm_medium gets lost in SPA

查看:50
本文介绍了utm_source 和 utm_medium 在 SPA 中丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 SPA 应用程序和分析有一个奇怪的问题.某些用户的源/媒体参数在会话期间丢失.

I've got a weird problem with my SPA application and analytics. The source/medium parameters are being lost during the session for some users.

我按照推荐使用 Google 跟踪代码管理器使用历史 API,并且它工作正常.但是大约 30% 的用户丢失了他们的 utm 参数并成为推荐人.我不明白这种行为,有人见过吗?

I'm using the history API using Google Tag Manager as recommended, and it works. But for approximate 30% of the users loose their utm parameters and becomes referrals. I don't understand this behaviour, anyone seen this before?

所以,我知道 100% 是

So, I know that 100% are

(source/medium) = mySource / affiliate

但从分析来看,大约 30% 的人正在失去他们的 utm 参数,结果变成:

but looking in analytics, approximately 30% are loosing their utm parameters and it becomes:

(source/medium) = mySource / affiliate (70%)
(source/medium) = mysource.com / referral (30%)

有什么建议吗?我现在有点迷茫.

Any suggestions? I'm a bit lost right now.

推荐答案

由于网站是单页应用程序 (SPA),您很可能面临恶意推荐"问题.

As the sites is a Single Page Application (SPA), you are most likely facing the problem of 'Rogue Referral'.

如果是这种情况,会发生什么情况,您覆盖了 Analytics 命中中的 location 字段,丢失了原始的 UTM 参数,而推荐仍然随命中一起发送,因此 Analytics 会识别第二次点击成为新的流量来源.一种解决方案是存储原始页面 URL 并将其作为 location 发送,同时在 page 字段中发送实际访问的 URL.

If this is the case, what happens, is that you overwrite the location field in the Analytics hit, losing the original UTM parameters, whereas referral is still sent with the hit, so Analytics recognizes the second hit as a new traffic source. One of the solutions is to store the original page URL and send it as the location, while sending the actual visited URL in the page field.

非常好的文章 由 Simo Ahava 撰写的关于此主题的更多提示,可以为您提供帮助.

A very good article on this topic with further tips, by Simo Ahava, is available for your help.

这篇关于utm_source 和 utm_medium 在 SPA 中丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆