[Question] How to get the domain of the site
Description
Hello,
We have a doubt about how to collect the domain of the sites where our Pbjs adapter is implemented.
Now we collect it with the document.location or from setConfig.pageUrl but we are having some issues:
- With the pageUrl, we need the publishers to add in the code the domain and that's not what we want.
- If we collect with the document.location, we find that many times we find domains that do not correspond to the real page, for example: translate.yandex.ru, translate.googleusercontent.com, copyscape.com (crawler)...
Could you tell us what would be the correct way to collect this parameter?
Thank you in advance!
https://github.com/prebid/Prebid.js/issues/5637 has some background on this; prebid attempts to figure out the page even when publishers don't set it. Prebid doc is pretty explicit that adapters should use bidderRequest.refererInfo, but if you don't like the way that is generated, we're certainly open to feedback. What we don't want is every adapter gathering it via its own function or method.
Hello,
thank you for your reply. I've been checking and testing and there is one case that gives me problems. When the site where you are using our adapter goes through another service (for example google translate), the domain becomes my-domain-com.translate.goog, complicating the task of getting the real domain. Our intention is to receive it automatically without the publishers having to set it in the configuration. Is there any way to deal with this?
Thanks in advance
In your example, y-domain-com.translate.goog is the "real domain". There is no non-config method to get what you're looking for that we've been able to imagine.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.