如何实现我的网络应用程序的附属链接?
我使用 Java EE 平台构建了一个 Web 应用程序来销售我的一个软件。
现在我想把我的网站营销工作交给各个电子营销公司。但由于我必须向他们提供佣金,所以我应该知道谁发送流量。
我认为解决上述问题的一个方法是:
为每个电子营销公司创建一个单独的 URL,并为其提供相应的 URL,并将所有这些 URL 重定向到单个 Servlet
。然后,数一下没有。特定 URL(电子营销公司的 URL)上的访问者数量来计算数量。该电子营销公司推荐的访客数量。
Google
和其他各种网站都使用类似的技术来区分彼此。
Q1。他们都使用这种方法吗?
第二季度。有没有其他方法可以更好地完成此任务?
您还可以提出其他一些建议...
提前致谢
I have built a web application using Java EE platform that sells one of my software.
Now I want to give the work of marketing my website to various e-marketing companies. But as I will have to give the commission to them, I should know that who sends the traffic.
I think that one solution to above problem is:
Make a separate URL for each e-marketing company and give them their corresponding URL and redirect all those URLs to a single Servlet
. And after that, count the no. of visitors on a particular URL (url of an e-marketing company) to count the no. of visitors referred by that e-marketing company.
The Google
and various other use similar kinds of techniques which distinguishes one from other.
Q1. Do all of them uses this kind of approach?
Q2. Is there any other approach by which this can be done in a much better way?
You can also advice some other things too...
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
关于 aefxx 关于片段标识符的回答,我认为这种方法的好处是保持 SEO 排名。如果是这样,您仍然可以使用查询字符串来管理它,但您必须在 Google 网站管理员工具中将它们设置为忽略。我认为 Bing 和 Yahoo 也可能有类似的机制。这样,您仍然可以基于查询字符串进行跟踪,事实上,如果您愿意,您还可以在 Google Analytics(不跟踪片段标识符)中跟踪它,无需进行自定义。
Regarding aefxx's answer about fragment identifiers, I assume that the benefit of this approach is maintaining SEO rank. If so, you can still manage this with querystrings, but you have to set them to be ignored in Google Webmaster Tools. I assume Bing and maybe Yahoo have similar mechanisms. That way, you can still track based on querystring, and in fact you can also track it in Google Analytics (which doesn't track fragment identifiers) with no customization if you prefer.
与之前的答案非常相似 - 您可以为每个联属网站提供他们将提交的唯一密钥(在 URL 中)。您的服务器应用程序将(解密并)将密钥与联属网站列表进行匹配,并计算潜在客户的来源。
Pretty much similar to the previous answer - you can give each affiliate web site a unique key (in the URL) that they would submit. your server application will (decipher and) match the key against a list of affiliate web sites and count the leads origin.
为什么不使用已有的东西呢?我正在谈论 HTTP 协议及其标头字段之一:Referrer(通常传递到环境变量 HTTP_REFERER 或 HTTP_REFERRER 中的代码)。
虽然它不是 100% 防弹(但话又说回来,什么是 100% 防弹?)我认为这对于你的情况来说已经足够了。我假设与联营公司关联的您的客户是从他们的网站之一推荐的?如果是这样,您就可以轻松区分来自不同电子营销公司的客户,因为每个客户都应该有自己的域名。
详细了解Referrer 字段。请记住,虽然引荐来源网址欺骗或隐藏是可能的,但可能性很小(查看我的服务器日志文件,估计有 95% 的访问者确实发送了引荐来源网址字段)。
问候。
Why not using what's already there? I'm talking about the HTTP protocol and one of its header fields: Referrer (typically passed to code in the environment variable HTTP_REFERER or HTTP_REFERRER).
Though it's not 100% bullet proof (but then again, what's a 100% bullet proof?) I think it could be sufficient in your case. I assume that customers of yours which are associated with an affiliate are reffered from one of their sites? If so, it would be easy for you to distinguish between customers coming from different e-marketing companies as each of them should have their own domain name.
Read more about the Referrer field. Keep in mind though that referrer spoofing or hiding is possible but very very unlikely (going over my server logfiles it's an estimated 95% of all my visitors that do send the referrer field).
Regards.
您也可以使用查询字符串参数。 (这可能就是克拉西布所指的。)
就像 http://yoursite.foo/yourpage.jsp?affiliateid=ABC123
然后就可以了让该单页从 URL 解析查询字符串并存储/计数。
You could use a Query String parameter, too. (This may be what krassib was referring to.)
Like http://yoursite.foo/yourpage.jsp?affiliateid=ABC123
Then just have that single page parse the querystring from the URL and store/count that.
是的,我同意 @krassib 和 @TomR - 使用 queryString 参数,然后您可以编写一个 servlet 过滤器来检查特定参数并增加该附属机构的计数。使用 servlet 过滤器还可以为您带来额外的好处,即可以跟踪每个联属会员的单个链接的数量。
您执行如下操作:
然后将类似的内容添加到您的 web.xml 中:
并为所有 servlet 建立一个过滤器映射。
Yep i agree with @krassib and @TomR - use a queryString parameter, then you can write a servlet filter to check for the specific paramater and increment the count for that affiliate. Using a servlet filter would also give you the added bonus of being to track the count of individual links on a per affiliate basis.
You do something like the following:
Then add something like this to your web.xml:
And have a filter mapping for all of your servlets.
据我所知,有 3 种可能性:
在我看来,通过捕获引用网址,最好的是第一个选择。这可能就是为什么这是最广泛使用/了解的原因。
您可能希望实施 cookie 来“记住”访问者来自哪家公司,因此当访问者(第一次访问时尚未决定购买任何东西)返回并购买东西时,您就会知道是哪家公司介绍的您的网站给他们。
afaik, there are 3 possibilities:
the best, in my opinion, is the first option. which is probably why this is the most widely used/know.
you'd probably want to implement cookie to "remember" that a visitor coming from which company, so when a visitor --who haven't decide to purchase anything on first visit-- returns and buy something, you will know which company introduce your site to them.
好的,这是另一张。您可以使用锚点方法。让我解释一下:
想象一下,
http://myappz.com/fooshop_cs
是销售产品的 URL,这是您分发给联属会员的 URL,但每个 URL 都有微小的变化。您只需通过劫持 片段标识符(即http ://myappz.com/fooshop_cs#em001
)。当用户通过链接访问已使用唯一 ID 收费的网站后,您可以使用 Javascript (
location.href.search(/#em\d*/)
) 检查 ID 是否存在。一旦找到 ID,您只需触发 AJAX 调用即可将该附属机构提升一个档次(我可能会推荐使用 jQuery 框架来执行此操作)。这种方法的好处是搜索引擎不关心片段标识符,并且您将能够从单个页面销售您的产品。您的用户也不会关心,因为锚点对他们绝对没有影响(除非您在页面中设置锚点标签)。
再见
Ok, here's another one. You could use the anchor method. Let me explain:
Imagine that
http://myappz.com/fooshop_cs
is the selling product's URL and this is what you distribute to your affiliates but each with a small variation. You simply add a unique ID to the URL by hijacking the fragment identifier (i.e.http://myappz.com/fooshop_cs#em001
).Once a user follows a link to your site that has been charged with a unique ID, you check for the IDs existence using Javascript (
location.href.search(/#em\d*/)
). Once you found an ID you simply trigger an AJAX call to take that affiliate up a notch (I may recommend the jQuery framework to do so).The benefit of this approach is that search engines don't care about fragment identifiers and that you will be able to sell your product from a single page. Your users won't care either as the anchor has absolutely no impact on them (except you would setup an anchor tag within your page).
bye