PHP 或 Javascript 读取 clickbank hoplink cookie?
我需要编写一个 PHP 或 javascript,它可以读取当用户在到达我的任何销售页面之前单击我的会员的跳转链接之一时设置的 Clickbank Cookie。
怎样才能做到这一点呢?
这是我的示例:
我有一个主销售页面,我将我的推荐的用户(已经认识我且未被联属会员推荐的用户)引导至该页面。它不使用 ClickBank 作为支付网关。
我还有一个专门用于 Clickbank 推荐的销售页面。它使用 ClickBank 来清算交易。
我想将脚本添加到我的销售页面,该脚本将检查用户是否有一个活动 cookie,该 cookie 表示他们已通过跳转链接引用到我的产品页面。如果是这样,我想将他们重定向到我的产品的 Clickbank 销售页面。
非常感谢任何帮助。
I need to write a PHP or javascript that can read the clickbank cookie that's set when a user has clicked on one of my affiliate's hoplinks prior to reaching any of my sales pages.
How can one do this?
Here's my example:
I have a main salespage that I direct my referred users to (users who already know me and were not referred by an affiliate). It does not use ClickBank as a payment gateway.
I also have a salespage specifically for clickbank referrals. It uses ClickBank to clear transactions.
I would like to add script to MY salespage that will check to see if the user has an active cookie that denotes they've been referred to my product page by a hoplink. If so, I want to redirect them to the clickbank sales page for my product.
Any help much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我知道点击库是如何工作的,他试图解释一些不同的东西。
当联属营销人员将访问者发送到他的销售页面时,它会在末尾添加联属营销 ID (fx mysite.com/?id=nick)
人们还可以直接访问他的销售页面(例如 mysite.com),只需输入他的 url。因此,他想检查访问者是直接访问还是通过附属链接访问。
所以你必须先回答:
- 您是否在访客浏览器中保存cookie(如果没有,您不必担心您的问题)?
-如果没有,那么@Robert 的回答将会帮助你......
I know how the clickbank works and he tried to explain something different.
When affiliates sending visitors to his sale page, it adds the affiliate id at the end (fx mysite.com/?id=nick)
People can also come to his sale page directly(like mysite.com) simply typing his url. So he wants to check if the visitor come directly or with an affilate link.
So you have to answer first :
-Are you saving cookies at visitor browser(if not, you don't have to worry about your problem)?
-If not, then @Robert answer is going to help you...
您无法读取不属于您的域的 cookie。因此,如果 ClickBank 为
clickbank.com
设置 Cookie,那么您将无法从yourdomain.com
访问它们。如果您共享域的一部分,那么就可以。例如。 clickbank.example.com 和 yoursite.example.com cookie 可以设置为 example.com 并由两者读取。然而,clickbank 必须做出这个改变,所以我认为你可能不走运。
You can't read cookies for a domain that isn't yours. So if ClickBank sets cookies for
clickbank.com
then you can't access them fromyourdomain.com
.If you share part of a domain then you can. Eg. clickbank.example.com and yoursite.example.com the cookies could be set to example.com and be read by both. However clickbank would have to make this change so I think you're probably out of luck.
@Balir McMillan 总结得很好,cookie 被锁定到设置它的域,包括子域等。
我不完全支持 ClickBank 的工作原理,但在我看来,您想要检查以确保推荐是来自 Clickbank 跃点。
您可以在 PHP 中检查
$_SERVER['HTTP_REFERER']
来检查引荐来源网址,但我会告诉您这可能是伪造的,应谨慎使用@Balir McMillan summed it up pretty well, cookies are locked to the domain that set it, that includes sub domains etc.
I am not fully shore how ClickBank works but it seems to me that you want to check to make sure that the referral was from a clickbank hop.
What you can do in PHP is check the
$_SERVER['HTTP_REFERER']
to check the referrer, but I will tell you this can be faked and should be used with caution或者,您可以直接从 URL 获取 hop 变量并重定向到您的联属营销页面。
Or you could get the hop variable directly from the URL and redirect to your affiliate sales page.