如何在actionscript小部件中准确获取引用者

时间:2021-11-21 18:53:56

I have an embedable widget. For each impression, I would like to track the referrer (the page where the widget is embedded onto). Right now I am using ExternalInterface to use javascript to check window.location.href when its available, however, I am finding that most of the time I am unable to set the referrer.

我有一个可嵌入的小部件。对于每次展示,我都想跟踪引荐来源(嵌入小部件的页面)。现在我使用ExternalInterface来使用javascript检查window.location.href,但是,我发现大多数时候我无法设置引用者。

Is there a better way to do this? Or perhaps am I not using javascript correctly to get the referrer?

有一个更好的方法吗?或者我可能没有正确使用javascript来获取推荐人?

Thanks!

1 个解决方案

#1


0  

I don't think you can directly get it in this way. There are a couple options I can think of:

我认为你不能以这种方式直接得到它。我能想到几个选项:

  1. Get the referrer from your web server HTTP logs. Apache for example logs referrer info by default.
  2. 从Web服务器HTTP日志中获取引荐来源。例如Apache默认情况下记录引用者信息。

  3. Have people include some referral code in their widget request, that you can use to identify where it came from.
  4. 让人们在他们的窗口小部件请求中包含一些引用代码,您可以使用它们来识别它的来源。

  5. Make a request from your widget back to your server...I think this request will contain the HTTP Referrer field pointing at where it is embedded
  6. 从您的小部件请求返回到您的服务器...我认为此请求将包含指向其嵌入位置的HTTP Referrer字段

  7. Use something like [swfmill][1] to embed the referrer into the actual SWF itself when it is requested from your server...but this might have too much performance overhead.
  8. 当服务器请求时,使用类似[swfmill] [1]的东西将引用者嵌入到实际的SWF中......但这可能会产生太多的性能开销。

#1


0  

I don't think you can directly get it in this way. There are a couple options I can think of:

我认为你不能以这种方式直接得到它。我能想到几个选项:

  1. Get the referrer from your web server HTTP logs. Apache for example logs referrer info by default.
  2. 从Web服务器HTTP日志中获取引荐来源。例如Apache默认情况下记录引用者信息。

  3. Have people include some referral code in their widget request, that you can use to identify where it came from.
  4. 让人们在他们的窗口小部件请求中包含一些引用代码,您可以使用它们来识别它的来源。

  5. Make a request from your widget back to your server...I think this request will contain the HTTP Referrer field pointing at where it is embedded
  6. 从您的小部件请求返回到您的服务器...我认为此请求将包含指向其嵌入位置的HTTP Referrer字段

  7. Use something like [swfmill][1] to embed the referrer into the actual SWF itself when it is requested from your server...but this might have too much performance overhead.
  8. 当服务器请求时,使用类似[swfmill] [1]的东西将引用者嵌入到实际的SWF中......但这可能会产生太多的性能开销。