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

Configurable sync URLs #763

Merged
merged 11 commits into from
Jan 7, 2019
Merged

Configurable sync URLs #763

merged 11 commits into from
Jan 7, 2019

Conversation

dbemiller
Copy link
Contributor

@dbemiller dbemiller commented Dec 7, 2018

This would be a breaking change for Prebid Server host companies. It's an alternative to #753 that I think puts the project in a better place moving forward.

How may this break things?

If merged, Prebid Server host companies will need to update any config.adapters.{bidder}.usersync_url config parameters that they define. If you haven't defined any of these, you have nothing to update. If you do define them, keep reading.

If you deploy with any config.adapters.{bidder}.usersync_url values defined, you must:

  1. Replace {{gdpr}} with {{.GDPR}}.
  2. Replace {{gdpr_consent}} with {{.GDPRConsent}}.
  3. Define the config value to be the full URL that you want Prebid Server to return for that Bidder when /cookie_sync is called. Before these changes, some bidders only interpreted these changes as config values as "URL fragments." After these changes, all Bidders will expect the full URL.

What does this improve?

A few things.

First: It makes Prebid Server config more flexible so that it's easier to run in test environments (e.g. load & integration tests). The config values can be pointed to mock servers without those servers having to be updated whenever a Bidder's actual sync URL changes.

Second: We've been having some bugs with AMP due to invalid usersync URLs. Publishers are seeing these in the terminal and get worried. Most recently, these are coming from some code in the 33across usersyncer. We're looking for ways to minimize these errors. To catch this most recent bug today, we would have to write custom validation logic for this Bidder (config.adapters.33across.partner_id is a required config value, but config.adapters.{everyone-else}.partner_id is not). After these changes, it'll be easy to implement some simple isValidURL() validation logic that works across all the bidders.

Third: As noted above, that partner_id is specific to 33across. This was a totally legitimate addition to the project, given how their sync URL works. However, it also means they had to make changes to the PBS config in order to contribute their Bidder to the project. With the whole URL configurable, it would have been easier for them.

Fourth: It takes a major step towards an architecture that doesn't require Usersyncers for Bidders at all. After these changes, every Usersyncer in the project looks like:

func NewBidderSyncer(temp *template.Template) usersync.Usersyncer {
	return adapters.NewSyncer("bidderName", vendorConsentID, temp, syncType)
}

In a future change, we can move vendorConsentID and syncType into the bidder-info files and remove Usersyncers from the code completely. This would farther simplify things and make it easier to contribute Bidders to the project.

Fifth: It lets us use Golang Templates to populate GDPR info rather than having us implement our own.

This also fixes #509 by making all the defaults use https.

@dbemiller dbemiller added the breaking change - hosts Has breaking changes for companies that host Prebid Server label Dec 7, 2018
@dbemiller dbemiller requested a review from hhhjort December 7, 2018 17:06
@dbemiller
Copy link
Contributor Author

dbemiller commented Dec 7, 2018

TravisCI build is passing... not sure why the Github UI is showing them as in-progress.

@dbemiller dbemiller mentioned this pull request Dec 7, 2018
hhhjort
hhhjort previously approved these changes Dec 14, 2018
Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

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

LGTM

@dbemiller dbemiller merged commit 4651e2e into master Jan 7, 2019
@dbemiller dbemiller deleted the fully-configurable-sync-urls branch January 7, 2019 14:07
katsuo5 pushed a commit to flux-dev-team/prebid-server-1 that referenced this pull request Dec 1, 2020
* Added a config property for base usersync url. Updated the syncers to use it.

* Added tests for the new config.

* Made sync URLs fully configurable.

* Updated the gumgum syncer, and fixed some broken tests.

* Handled the errors.

* Cleaned up a test.

* Polished the grid syncer test a bit.

* Fixed a bug related to bidder ID string cases.
katsuo5 pushed a commit to flux-dev-team/prebid-server-1 that referenced this pull request Dec 2, 2020
* Added a config property for base usersync url. Updated the syncers to use it.

* Added tests for the new config.

* Made sync URLs fully configurable.

* Updated the gumgum syncer, and fixed some broken tests.

* Handled the errors.

* Cleaned up a test.

* Polished the grid syncer test a bit.

* Fixed a bug related to bidder ID string cases.
katsuo5 pushed a commit to flux-dev-team/prebid-server-1 that referenced this pull request Dec 4, 2020
* Added a config property for base usersync url. Updated the syncers to use it.

* Added tests for the new config.

* Made sync URLs fully configurable.

* Updated the gumgum syncer, and fixed some broken tests.

* Handled the errors.

* Cleaned up a test.

* Polished the grid syncer test a bit.

* Fixed a bug related to bidder ID string cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change - hosts Has breaking changes for companies that host Prebid Server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AMP user sync mixed content
2 participants