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

Add referer detection module #3067

Merged
merged 4 commits into from
Sep 12, 2018
Merged

Add referer detection module #3067

merged 4 commits into from
Sep 12, 2018

Conversation

jaiminpanchal27
Copy link
Collaborator

Type of change

  • Feature

Description of change

This PR adds referer detection module to prebid core. New property refererInfo is added to bidderRequest object.
Following details will be available to each bidder

{
  referer: <string|detected top url>,
  reachedTop: <bool|whether prebid was able to walk upto top window or not>,
  numIframes: <int| number of iframes>,
  stack: <string|comma separated urls of all origins>,
}

All bidders can access this info in buildRequests spec.

We will be deprecating utils.getTopWindowLocation and utils.getTopFrameReferrer soon.

Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See question/point below

location: null,
isTop: (currentWindow == win.top)
});
logError('Error while accessing cross domain iframe.', e);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be a logError? Based on my testing in a cross domain testpage in Chrome, the data still gets collected (due to available information in ancestor) but it also displays this error.

Should it be a warning instead perhaps?

stack: stackInfo.stack,
};
} catch (e) {
logError('Error while getting referer info', e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably don't need to log any errors from this module since it doesn't alter any behavior if something breaks. Bump down to warn or message.

Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@mkendall07 mkendall07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just needs a jsdoc for return object.

@jsnellbaker jsnellbaker merged commit 079e27f into master Sep 12, 2018
@aneuway2 aneuway2 mentioned this pull request Sep 14, 2018
1 task
ptomasroos pushed a commit to happypancake/Prebid.js that referenced this pull request Sep 25, 2018
* add referere detection module

* dont log all errors on console

* Update message

* Add jsdoc
StefanWallin pushed a commit to mittmedia/Prebid.js that referenced this pull request Sep 28, 2018
* add referere detection module

* dont log all errors on console

* Update message

* Add jsdoc
SublimeJeremy pushed a commit to SublimeSkinz/Prebid.js that referenced this pull request Oct 1, 2018
* add referere detection module

* dont log all errors on console

* Update message

* Add jsdoc
ghost pushed a commit to devunrulymedia/Prebid.js that referenced this pull request Jan 30, 2019
* add referere detection module

* dont log all errors on console

* Update message

* Add jsdoc
pedrolopezmrf pushed a commit to Marfeel/Prebid.js that referenced this pull request Mar 18, 2019
* add referere detection module

* dont log all errors on console

* Update message

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

Successfully merging this pull request may close these issues.

3 participants