我目前正在开发一项功能,可以跟踪注册/登录我网站的用户的来源,包括社交媒体或自然搜索。
一个简单的解决方案是使用 <div id="gallery-1" class="gallery galleryid-35 gallery-columns-3 gallery-size-medium"><dl class="gallery-item">
<dt class="gallery-icon landscape">
<a href="http://mypage.local/wp-content/uploads/2017/08/3.jpg" data-fancybox="gallery1" data-caption="
Caption for this image #3
"><img width="300" height="300" src="http://mypage.local/wp-content/uploads/2017/08/3-300x300.jpg" class="attachment-medium size-medium" alt="" aria-describedby="gallery-1-34" srcset="http://mypage.local/wp-content/uploads/2017/08/3-300x300.jpg 300w, http://mypage.local/wp-content/uploads/2017/08/3-150x150.jpg 150w" sizes="(max-width: 300px) 100vw, 300px"></a>
</dt>
<dd class="wp-caption-text gallery-caption" id="gallery-1-34">
Caption for this image #3
</dd></dl><dl class="gallery-item">
<dt class="gallery-icon landscape">
<a href="http://mypage.local/wp-content/uploads/2017/08/2.jpg" data-fancybox="gallery1" data-caption="
Caption for this image #2
"><img width="300" height="300" src="http://mypage.local/wp-content/uploads/2017/08/2-300x300.jpg" class="attachment-medium size-medium" alt="" aria-describedby="gallery-1-33" srcset="http://mypage.local/wp-content/uploads/2017/08/2-300x300.jpg 300w, http://mypage.local/wp-content/uploads/2017/08/2-150x150.jpg 150w" sizes="(max-width: 300px) 100vw, 300px"></a>
</dt>
<dd class="wp-caption-text gallery-caption" id="gallery-1-33">
Caption for this image #2
</dd></dl><dl class="gallery-item">
<dt class="gallery-icon landscape">
<a href="http://mypage.local/wp-content/uploads/2017/08/1.jpg" data-fancybox="gallery1" data-caption="
Caption yeah
"><img width="300" height="300" src="http://mypage.local/wp-content/uploads/2017/08/1-300x300.jpg" class="attachment-medium size-medium" alt="" aria-describedby="gallery-1-32" srcset="http://mypage.local/wp-content/uploads/2017/08/1-300x300.jpg 300w, http://mypage.local/wp-content/uploads/2017/08/1-150x150.jpg 150w" sizes="(max-width: 300px) 100vw, 300px"></a>
</dt>
<dd class="wp-caption-text gallery-caption" id="gallery-1-32">
Caption yeah
</dd></dl><dl class="gallery-item">
<dt class="gallery-icon portrait">
<a href="http://mypage.local/wp-content/uploads/2017/08/unit.png" data-fancybox="gallery1" data-caption="
Caption text
"><img width="250" height="251" src="http://mypage.local/wp-content/uploads/2017/08/unit.png" class="attachment-medium size-medium" alt="" aria-describedby="gallery-1-10" srcset="http://mypage.local/wp-content/uploads/2017/08/unit.png 250w, http://mypage.local/wp-content/uploads/2017/08/unit-150x150.png 150w" sizes="(max-width: 250px) 100vw, 250px"></a>
</dt>
<dd class="wp-caption-text gallery-caption" id="gallery-1-10">
Caption text
</dd></dl>
</div>
来跟踪用户来源,但是它不符合我的要求,因为如果用户通过自然搜索访问网站,它不起作用,例如。来自谷歌。
是否有任何其他解决方案或实施方案可以跟踪访问我们网站的用户来源,这些用户提供更广泛和更广泛的覆盖范围,包括来自有机搜索。
答案 0 :(得分:0)
虽然Ahoy非常适合跟踪您的网页使用情况,但它似乎不足以跟踪视图的来源,您可以将Google Analytics用于单独的统计信息页面,也可以结合{{{ 1}}。
在Rails中,您可以使用utm_source
- 对象来查看请求标头,如下所示。
编辑:那是在请求之下。
<强>来源:强>