简体   繁体   English

使用.htaccess重定向我的会员链接并在Google Analytics(分析)中进行跟踪

[英]Using .htaccess to redirect my affiliate link and track in Google Analytics

Helo all, 大家好,

I'm a novice affiliate marketer, but I'm already making web hosting sales by placing my affiliate link in a number of places. 我是新手会员营销商,但是我已经通过将我的会员链接放置在许多地方来进行网络托管销售。 I'd like to do the following: 我想做以下事情:

  1. Mask my affiliate link using my main domain name ie www.mydomain.com/affiliate-link 使用我的主要域名掩盖我的会员链接,即www.mydomain.com/affiliate-link

  2. Track the re-direct using Google Analytics. 使用Google Analytics(分析)跟踪重定向。

I've tried creating the directory "affiliate-link" on my server with the following .htaccess code: 我尝试使用以下.htaccess代码在服务器上创建目录“会员链接”:

RewriteEngine On
RewriteRule ^$ http://my.affiliate-link.com/aff.php?1234&utm_source=Name&utm_medium= referral-link&utm_campaign=hosting-affiliate

I used Google's url builder to generate the code. 我使用Google的网址生成器来生成代码。 The redirect works when I go "www.mydomain.com/affiliate-link", but Google analytics isn't showing any data. 当我转到“ www.mydomain.com/affiliate-link”时,重定向有效,但Google Analytics(分析)未显示任何数据。 Am I doing something wrong? 难道我做错了什么? I'm assuming I need to add the campaign I've created via the link builder to Google Analytics? 我假设我需要将通过链接生成器创建的广告系列添加到Google Analytics(分析)?

Thanks! 谢谢!

You are sending traffic to my.affiliate-link.com, so it will show up in the analytics for that website. 您正在将流量发送到my.affiliate-link.com,因此它将显示在该网站的分析中。

You are exiting when you click on www.mydomain.com/affiliate-link, so analytics will not get a chance to fire again. 当您单击www.mydomain.com/affiliate-link时,您将退出,因此分析将不再有机会再次触发。 Your affiliate will get the source details added at their end. 您的会员将在其末尾添加源详细信息。

You would be better off getting a GA expert to answer this, but you would be best to track clicks with event tracking code, I assume. 最好让GA专家来回答这个问题,但是我认为,最好使用事件跟踪代码来跟踪点击。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM