weixin_33716154 2016-01-24 14:29 采纳率: 0%
浏览 27

Pixel与Ajax进行分析

I am tasked with building a simple analytics server.

I read some articles, which talks of some of the pros/cons of using ajax vs pixel: https://www.admonsters.com/blog/pixel-delivery-best-practices and https://alexcsantos.wordpress.com/2015/12/17/high-performance-cross-domain-events-tracking/

I see the benefits of both. However, I am leaning towards ajax with post only because of the url limits i have read.

What i do not know is if the url is just a tracking pixel and i do something like this:

btoa(JSON.stringify(data));

Does the browser url limit matter? Lets say the parameters (key, values) in the variable data are very long, but it we only care that the data gets to our server, will the browser get hung up on this, particularly older browsers like IE < 9.

Edit: The data can get long because we need to track individual ids that are on the page. For instance, this is for an e-commerce site. When a user goes to a search page we need to record all product ids on that page. The ids are normally 15 digit numbers like: 8174254394082605294 or -9156993181215463331. I am not sure if this is a problem, i wont know until testing.

My big question is if the url character length gets to long for older browser, what is the behavior? Will it not ping out server?

Obviously testing will take place, i am just curious if someone already knows the answer to this question.

Also has anyone built something similar and know the pros/cons of pixel vs ajax.

In my mind, pixel is easier. In our api, we can have something that returns the entire image src and then we can just pull it from the api and put it on the page.

Thoughts?

Thanks for taking the time to read/answer

Brian

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
    • ¥15 活动选择题。最多可以参加几个项目?
    • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
    • ¥15 vs2019中数据导出问题
    • ¥20 云服务Linux系统TCP-MSS值修改?
    • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
    • ¥20 怎么在stm32门禁成品上增加查询记录功能
    • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
    • ¥50 NT4.0系统 STOP:0X0000007B
    • ¥15 想问一下stata17中这段代码哪里有问题呀