2014-06-18 28 views
3

我可以用图像像素调用多个跟踪像素吗?我可以用图像像素调用多个跟踪像素吗?

我主要跟踪像素会 - >

<img src="http://domain.com/pixel/123" alt="" style="height:1px;width:1px;border:0 none" /> 

但是,如果我这样做的mod_rewrite,可我还呼吁在phph文件中的其他像素?

基本上,我只能放置一个跟踪像素,但需要从下面调用所有像素。

<img src="http://domain.com/pixel/123" alt="" style="height:1px;width:1px;border:0 none" /> 
<img src="http://domain1.com/pixel/232" alt="" style="height:1px;width:1px;border:0 none" /> 
<img src="http://domain2.com/pixel/745" alt="" style="height:1px;width:1px;border:0 none" /> 
<img src="http://domain3.com/pixel/478" alt="" style="height:1px;width:1px;border:0 none" /> 
<img src="http://domain4.com/pixel/894" alt="" style="height:1px;width:1px;border:0 none" /> 

此外,对于任务,我可以'使用服务器到服务器跟踪或iframe跟踪。所以我需要一种方法来将上面的像素加载到一个文件中。

回答

2

您正在从5个不同的域加载5个不同的资源(跟踪像素),所以您需要客户端执行5个请求:服务器端的东西不会工作(服务器只会为“domain.com” “,而”domain * .com“则为no)。

您可以使用具有5背景图像层CSS:

  • 外部,通过<link rel="stylesheet" type="text/css" href="..."/>
  • 内部装载有<style>...</style>
  • 一个style属性内部)

实施例与style属性:

<div style="background-image: url('http://domain.com/pixel/123'), url('http://domain1.com/pixel/232'), url('http://domain2.com/pixel/745'), url('http://domain3.com/pixel/478'), url('http://domain4.com/pixel/894');">&#xnbsp;</div> 

如果CSS未启用,跟踪将不起作用。 您可以将style属性放在现有元素上。

目前除了没有别的办法(如果编辑我已经忘记一些):

  • <img.../>标签
  • CSS background-image: url()...;
  • <iframe...></iframe>
  • <link.../>(然后是“跟踪像素“成为”跟踪CSS /外部资源“)
  • Javascript loading(XMLHttpRequest或其他加载方式来源)