document referrer being used instead of window.location.href, why?

1,328 views
Skip to first unread message

David Stanton

unread,
Aug 12, 2020, 4:42:42 PM8/12/20
to Interactive Media Ads SDK
I believe you are using document.referer where we're expecting window.location.href or similar, this is throwing all sorts of problems, especially with google ads.txt reports and ultimately with ADX ads and other ads, they think the domains are such as facbook.com etc, where the user has come from and not the page they are on

IMA SDK

unread,
Aug 12, 2020, 6:04:58 PM8/12/20
to davids...@spormeon.com, ima...@googlegroups.com
Hi David,

Thank you for reaching out to us. Can you provide more details about the issue you're facing with the IMA SDK?

Regards,
Arnaud Casame
IMA SDK Team


ref:_00D1U1174p._5004Q23Jm33:ref

David Stanton

unread,
Aug 12, 2020, 6:21:39 PM8/12/20
to Interactive Media Ads SDK
hi

the problem seems to be that,  when a visitor, visit our site,  Google is seeing that user as being from the site it came from, rather than being on the page on the site, we believe this is because of document.referrer rather than window.location.href or similar being used.  This actually "illustrates" the point from google themselves through google ad manager, the ads.txt shown, google thinks are coming from different domains,  obvioulsy we are trying to monetise with Adx, so as there are loads of ads.txt annomolies, these arn't paid imps but we dont have any ads on/ any where near these domains, so we believe the sdk is passing along the last "entrance" page url, rther than the url that the user is on the site.


this ad manager is only being used for 1 video ad unit, so all of these below referrer to the requests for this 1 video unit and they all show the say pub ID (adx account, which is a adx video account).  The figures also bare out in what we see in dfp stats reports, with "unfilled" imps and "served request", but only a fraction filled imps, due to there being only 1/3 of request being seen to come from the sites domain


Google_Ad_Manager_-_Ads_txt_management.png

David Stanton

unread,
Aug 12, 2020, 6:37:24 PM8/12/20
to Interactive Media Ads SDK
to iterate on,   the url is over written by the SDK anyway, so its the SDK thats picking up "facebook" from somewhere and sending to GAM.  I presume its the url thats picked up by way over overwrite, so as the url can't be "conned", that is what google uses to work out what domian the request are from and in turn build out these ads.txt reports in GAM and bid on request etc with Adx : https://support.google.com/admanager/table/9749596?hl=en&ref_topic=2480647

IMA SDK

unread,
Aug 13, 2020, 2:08:24 AM8/13/20
to davids...@spormeon.com, ima...@googlegroups.com

Hi David,

Thanks for getting back to us and for sharing additional insights regarding this issue. However, could you please confirm that your ads are not being hosted other than from your own domain? I’m asking this because according to this documentation the document.referrer should return an empty string if the user navigated to the page directly, or inside an <iframe>, the document.referrer will initially be set to the same value as the href of the parent window's Window.location.

However, for us to check further, could you please provide the following information?

  • A sample project file or a test page wherein this issue is reproducible
  • Ad tag having this issue that is being used


Please share the above information directly by sending to our email alias imate...@gmail.com

Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5004Q23Jm33:ref

Applixir Team

unread,
Aug 13, 2020, 6:40:02 PM8/13/20
to Interactive Media Ads SDK
Hi Sherwin,

In the hope of saving some time, this is the same problem I reported in "IMA SDK Feature or Problem" that your team is currently working on.

David, if you look at that thread (which is quite long) I think you will see we are discussing the same issue.

Thanks,

Applixir Team

IMA SDK

unread,
Aug 14, 2020, 2:59:03 AM8/14/20
to de...@applixir.com, ima...@googlegroups.com

Hi there,

Thanks for your message. I can’t tell if this related to the said issue as it is mentioned in the earlier email that they don’t have any ads anywhere near these domains, so I think this is a different issue. Could you please confirm this David?



Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5004Q23Jm33:ref

David Stanton

unread,
Aug 14, 2020, 3:20:28 AM8/14/20
to Interactive Media Ads SDK
I think it inadvertently might be the same issue.  I've since had the site owner make some code changes.  It seems they had placed code for video ads in their "facebook instant pages" code.  I have to wait about 7 days now though to see if the "ads.txt' errors in ad manager come down, to where they should be.  Fingers crossed that solves my issue, but i think it also helps highlight to some extent this issue that games providers and any other content provider, that distributes in a similar way has/ might have.  There must be literally billions being sent out the window with this, where its legitimate use to distribute in such as way.

Applixir Team

unread,
Aug 14, 2020, 4:37:11 AM8/14/20
to Interactive Media Ads SDK
Hi Sherwin, David,

After reviewing David's issue again I agree that I can't tell for sure if this is the same issue since one important detail isn't mentioned. 

David, if this problem only happens when you are running within aggregation sites like facebook.com when using Chrome and other browsers based on Chromium but doesn't happen on the same sites when using Firefox or other non-Chromium browsers then it's the same problem. If not, it's a related but different problem.

Hope this helps,

Applixir Team

David Stanton

unread,
Aug 14, 2020, 5:21:18 AM8/14/20
to Interactive Media Ads SDK
not tested in FF to be honest,  I'm more interested in getting rid of the ads.txt problem , so using chrome on mac to hunt it down sort of idea.  As its been found in facebook instant pages,  I/ we cant have 3rd party ads there anyway, so if it fixes my ads.txt problem,  its "all sorted" for me,  I just have to wait 7 days or so to find out, for the ads.txt report to work its way out.

IMA SDK

unread,
Aug 14, 2020, 8:03:32 AM8/14/20
to davids...@spormeon.com, ima...@googlegroups.com

Hi David,

Thanks for your message and for confirmation. It seems, pending the results of the workaround that you’ve done, all we can do now is to wait. However, feel free to get back to us if you have any further questions or concerns.



Regards,
Sherwin Diesta
IMA SDK Team



ref:_00D1U1174p._5004Q23Jm33:ref

Tobias Klipstein

unread,
Aug 14, 2020, 9:49:41 AM8/14/20
to Interactive Media Ads SDK
Hi David,

I'm not part of the IMA-Team but I saw your message around Facebook Instant Pages and we had a similar issue in the past.

The problem is with how embedding in Instant Pages works. It kind of acts as a mirror of your canonical page with a limited feature set and the only mechanism to get custom things on the page is via wrapping it in an iframe. Back then we thought that we would embed the video player via `<iframe src="https://our-player">` but then you'll hit the issue that the actual "canonical URL" will be "facebook.com".

The trick at least back then was to wrap your player-iframe into an empty iframe. It sounds weird, but the empty <iframe> will then run on the canonical URL of your page.

So please try:

<figure class="op-interactive">
    <!-- weird wrapping starts here -->
    <iframe width="1600" height="900">
        <style>
            body {
                margin: 0;
            }

            .responsive-container {
                position: relative;
                padding-bottom: 56.25%;
                height: 0;
            }

            .responsive-container iframe {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                border: 0;
            }
        </style>
        <div class="responsive-container">
            <iframe src="https://our-player"></iframe>
        </div>
    </iframe>
</figure>

Hope this helps you.

Regards, Tobias

David Stanton

unread,
Oct 17, 2020, 6:42:23 AM10/17/20
to Interactive Media Ads SDK
i seem to be getting this again, with all sorts of weird and wonderful url's appearing in my GAM reports, there must be a reason/ a way around this surely?

the one "blanked" out is actually the url where the video player is, the rest we have no clue on (their obviously where traffic is coming from). we are conducting this as a "test setup' on a small site, so as we can "irn" out this proeblem

Google_Ad_Manager_-_Reports.png

Reply all
Reply to author
Forward
0 new messages