Modifier/redirect for Google Shopping ads (DoubleClick) being blocked by Adguard DNS filter

Chris4

New Member
If you have the Adguard DNS filter enabled, you'll know that within the Google app (I'm on Android) you can't select any Shopping ad, which are often the top result for search queries. When you select it, a page opens with the URL starting `ad.doubleclick.net/ddm/clk` and is blocked.

For example, I did a Google search for "TV" and selected a Google Shopping ad/listing

Code:
https://ad.doubleclick.net/ddm/clk/465758560;270927818;z;u=ds&sv1=67389284558&sv2=3292045339879063&sv3=7567459458374082709&gclid=Cj0KCQiA3-yQBhD3ARIsAHuHT65uI2qqyKmPaH2wuKdnVo01eisTOAzdU0_uRPz9yvuy2C5jBZVOfXcaAs2NEALw_wcB;%3fhttps://www.argos.co.uk/product/9498967?storeID=526&istCompanyId=a74d8886-5df9-4baa-b776-166b3bf9111c&istFeedId=30f62ea9-9626-4cac-97c8-9ff3921f8558&istItemId=pirlqramp&istBid=t&&cmpid=GS001&_$ja=tsid:59157%7cacid:416-707-6621%7ccid:9567730957%7cagid:98490215736%7ctid:pla-1459280480536%7ccrid:423217901962%7cnw:g%7crnd:14542737549272035351%7cdvc:m%7cadp:%7cmt:%7cloc:1006621&utm_source=Google&utm_medium=cpc&utm_campaign=9567730957&utm_term=9498967&utm_content=shopping&utm_custom1=98490215736&utm_custom2=416-707-6621&GPDP=true&gclid=Cj0KCQiA3-yQBhD3ARIsAHuHT65uI2qqyKmPaH2wuKdnVo01eisTOAzdU0_uRPz9yvuy2C5jBZVOfXcaAs2NEALw_wcB&gclsrc=aw.ds
which should take you to

Code:
https://www.argos.co.uk/product/9498967
That URL is within the long doubleclick URL, so you can manually extract and go to it without notifying Google's tracker you've clicked their ad.

Through Adguard custom rules, it possible to extract, modify or redirect to this URL? This would be the perfect solution to bypass the ad tracker. I've tried looking through the documentation but I can't work it out.
 

Chris4

New Member
Nope. DNS does not work that way.
Okay thanks for confirming. Ignoring DNS then, that ad tracker is permitted at a content filter level – with adblocking and tracking enabled, it still passes through the googleadservices/doubleclick tracker – assumingly because otherwise it would break the functionality as the DNS filter does. So what about modifying / redirecting the URL at the content filter level, is that possible?
 

Blaz

Moderator & Translator
Staff member
Moderator
You can use a rule which includes javascript to rewrite the url on google.com to avoid waiting for redirect of those pages (#%# rules). Redirect usually only takes a few milliseconds though.

EDIT: Something like this:

google.*#%#AG_onLoad(function() { setTimeout(function() { var b = document.querySelectorAll('a[href^="https:"][href*="%3fhttps"]'); b.forEach(function(b) { var c = b.href.split("%3f"); if(c[1]) { b.setAttribute("href", c[1]);} }); },1000) });
 
Last edited:

Chris4

New Member
Thanks very much for your suggestion @Blaz, but I don't think that's quite what I'm after. That solution would only apply on Google.com if I understand correctly, and I'm talking about from the app. I understand the limitations with that though. Let me try to clarify.

We're all here because we want to block ads and stop trackers right? So despite having tracker blocking enabled, if you open up the Google app on your phone, Google can track the Shopping ads you clicked on. They know what you're buying, essentially. With Adguard's DNS Filter enabled it does block the trackers altogether through the app, but then results in you not being able to access the product, like so:

ezgif.com-gif-maker (2).gif

Understandably, AdGuard can't apply inline content blocking within the app like it does on web. However, when you click a Google Shopping link, it pops open a web page and directs you through Google's ad network and then to the product. As this is the web, Adguard can insert itself here to stop the tracker. But instead of blocking it altogether so Google Shopping can't be used, why not play the system?

So the idea is - and if this works I think it would be a great permanent addition to the filter list - as the destination URL is within the DoubleClick tracking URL, it could extract that, stop processing it, and instead go straight to the product, therefore bypassing Google's tracking. Similar to your Google redirect solution above, but applied to the app through URL modification.

If you scroll through the long DoubleClick URL I posted above you'll see the destination product URL part way through it (hopefully clearer displayed now):

https://ad.doubleclick.net/ddm/clk/465758560;270927818;z;u=ds&sv1=67389284558&sv2=3292045339879063&sv3=7567459458374082709&gclid=Cj0KCQiA3-yQBhD3ARIsAHuHT65uI2qqyKmPaH2wuKdnVo01eisTOAzdU0_uRPz9yvuy2C5jBZVOfXcaAs2NEALw_wcB;%3fhttps://www.argos.co.uk/product/9498967?storeID=526&istCompanyId=a74d8886-5df9-4baa-b776-166b3bf9111c&istFeedId=30f62ea9-9626-4cac-97c8-9ff3921f8558&istItemId=pirlqramp&istBid=t&&cmpid=GS001&_$ja=tsid:59157%7cacid:416-707-6621%7ccid:9567730957%7cagid:98490215736%7ctid:pla-1459280480536%7ccrid:423217901962%7cnw:g%7crnd:14542737549272035351%7cdvc:m%7cadp:%7cmt:%7cloc:1006621&utm_source=Google&utm_medium=cpc&utm_campaign=9567730957&utm_term=9498967&utm_content=shopping&utm_custom1=98490215736&utm_custom2=416-707-6621&GPDP=true&gclid=Cj0KCQiA3-yQBhD3ARIsAHuHT65uI2qqyKmPaH2wuKdnVo01eisTOAzdU0_uRPz9yvuy2C5jBZVOfXcaAs2NEALw_wcB&gclsrc=aw.ds

If my understanding is correct, by processing this URL, Google tracks you've gone to that site, right? So my thought was, if we can extract the destination URL from this tracking URL before it can process it, we can potentially stop the tracker at that point and go to the destination while keeping our shopping habits out of Google's hands.

Is that possible through AdGuard's custom filter syntax? So you could turn DNS Filter off, and the custom content rule would bypass the tracker and take you to the product.
 
Last edited:

yskhoe

New Member
I've added the custom filtering rule:
||doubleclick.net^$domain=google.com

this blocks doubleclick.net except when coming from google.com. So it enables Google shopping ads from the google search page.

edit: weird, this rule should do the opposite and block all request to doubleclick.net from the google.com domain, but it seems to work for now.


If I follow the manual the rule should be: block doubleclick.net, except when coming from Google.com.
||doubleclick.net^$domain=˜google.com

tried it, seems to be working
 
Last edited:
Top