D
D
dimon1192016-02-13 21:44:51
PHP
dimon119, 2016-02-13 21:44:51

Adblock blocks js script. Will https help?

I am making a script that will send data to my server, the script will be installed on a third-party resource.
sub.site.com/js
site.ru - installs my sub.site.com/js to itself
my script collects information and sends it to sub.site.com
inside sub.site.com/js data is collected and sent, how to implement sending?
Option 1. I stuff all the data into get parameters and access them to a 1x1 pixel image that is generated in php and saves all the information. sub.site.com/img.gif?params=bla
The problem is that this method blocks Adblock
Option 2. I send data from sub.site.com/js using XMLHttpRequest but then the error in the browser is No 'Access-Control-Allow- Origin' header is present on the requested resource.
Tell me how can I implement this? if there is https on sub.site.com, will the adblock lag behind it?
Tell me more how Yandex Metrica implements sending data, there is also a 1x1 image but its adblock does not block

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Taratin, 2016-02-13
@Taraflex

if there is https on sub.site.com, will the adblock lag behind it?

No.
htaccess access control allow origin header

A
Andrey Fedorov, 2016-02-13
@aliencash

You need to define a rule that works in adblock - press Ctrl + Shift + V. Among the list of elements there will be blocked, and a triggered rule. Exclude the possibility of triggering for the site element.
I guess he doesn't like the 1x1 picture.

D
Dark Hole, 2016-02-13
@abyrkov

Personally, it seems to me that it is not the adblock that blocks, but the domain rule.
Try the old fashioned way, via the src of the new script

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question