Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdGuard filters cookies #3

Open
kklem0 opened this issue Jan 7, 2023 · 4 comments
Open

AdGuard filters cookies #3

kklem0 opened this issue Jan 7, 2023 · 4 comments

Comments

@kklem0
Copy link

kklem0 commented Jan 7, 2023

Hi,
I'm a Pro user.
I noticed that each view is considered a new user when using AdGuard, I haven't tested other AD blocker yet.
Here's the filter log, you can see the filter rule.

Screenshot 2023-01-08 at 00 47 26

@kklem0
Copy link
Author

kklem0 commented Jan 7, 2023

I guess if Cookieless works with GA4 it'll also be fine.
Google Site Kit uses GA4, I'm using Google Site Kit with Compatibility Mode.

@kklem0
Copy link
Author

kklem0 commented Jan 8, 2023

Can we replace _ga/_gat/_gid to somethine random first then change it back before forwarding to google?

@kklem0
Copy link
Author

kklem0 commented Jan 8, 2023

        if (empty($_COOKIE['_ga'])) {
            if (!empty($_COOKIE['p7YwEk']) && preg_match('/[0-9]{10}\.[0-9]{10}/', $_COOKIE['p7YwEk'])) {
                $cid = $_COOKIE['p7YwEk'];
            } else {
                $cid = rand(1000000000, 9999999999) . "." . rand(1000000000, 9999999999);
            }

            setcookie('p7YwEk', $cid, time()+60*60*365*2);
            $params['cid'] = $cid;
        }

        if (empty($_COOKIE['_gid'])) {
            if (!empty($_COOKIE['25gXt4ZH']) && preg_match('/[0-9]{10}\.[0-9]{10}/', $_COOKIE['25gXt4ZH'])) {
                $gid = $_COOKIE['25gXt4ZH'];
            } else {
                $gid = rand(1000000000, 9999999999) . "." . rand(1000000000, 9999999999);
            }

            setcookie('25gXt4ZH', $gid, time()+60*60*24*2);
            $params['_gid'] = $gid;
        }

Dumb fix that works for now.

@Dan0sz
Copy link
Owner

Dan0sz commented Jan 31, 2023

Hi!

I'm sorry for not responding. I don't check Github that often, because I don't receive messages here often. :-)

I'm working on a Cookieless version of GA4 in the next release of CAOS Pro. Would that solve your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants