Skip to content

Conversation

@april418
Copy link

@april418 april418 commented Jun 2, 2025

Type of change

  • Bugfix

  • Feature

  • New bidder adapter

  • Updated bidder adapter

  • Code style update (formatting, local variables)

  • Refactoring (no functional changes, no api changes)

  • Build related changes

  • CI related changes

  • Does this change affect user-facing APIs or examples documented on http://prebid.org?

  • Other

Description of change

  • Pass some parameters from getRefererInfo when getting ID from API.
    • Used as a datasource to infer IDs.
  • Fixed some code formatting.

Other information

@github-actions
Copy link

github-actions bot commented Jun 2, 2025

Tread carefully! This PR adds 2 linter errors (possibly disabled through directives):

  • modules/imuIdSystem.js (+2 errors)

@april418 april418 requested review from eknis and fecker June 2, 2025 06:49
const refererInfo = getRefererInfo();
return baseUrl
+ `page=${encodeURIComponent(refererInfo.page || '')}`
+ `&ref=${encodeURIComponent(refererInfo.ref || '')}`;
Copy link
Author

Choose a reason for hiding this comment

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

@fecker san
refererはoriginのみでいいってお話でしたが、パースしてoriginのみ抜き出すようにとかした方がいいですか?

@eknis
Copy link
Member

eknis commented Jun 2, 2025

@april418
Copy link
Author

april418 commented Jun 2, 2025

なにこれ

GithubのSecrets設定しないと動かないみたいですね😇

env:
  OAUTH2_CLIENT_ID: ${{ secrets.OAUTH2_CLIENT_ID }}
  OAUTH2_CLIENT_SECRET: ${{ secrets.OAUTH2_CLIENT_SECRET }}
  OAUTH2_REFRESH_TOKEN: ${{ secrets.OAUTH2_REFRESH_TOKEN }}

@april418 april418 force-pushed the imuidsystem-add-params branch from 4a7e5be to fffd6dd Compare June 2, 2025 07:41
@eknis
Copy link
Member

eknis commented Jun 2, 2025

Secrets設定が必要ならforkだしここでは気にしなくても良さそうですね

@april418
Copy link
Author

april418 commented Jun 2, 2025

動作確認はこんなファイル作ってやりました

<!DOCTYPE html>
<html lang="en">

<head>
  <title>User ID Modules Example</title>

  <script>
    var FAILSAFE_TIMEOUT = 2000;

    var adUnits = [
      {
        code: 'test-div',
        sizes: [
          [300, 250],
          [728, 90]
        ],
        bids: [{
          bidder: 'pubmatic',
          params: {
            publisherId: '156209',               // required, must be a string, not an integer or other js type.
            outstreamAU: 'renderer_test_pubmatic',   // required if mediaTypes-> video-> context is 'outstream' and optional if renderer is defined in adUnits or in mediaType video. This value can be get by BlueBillyWig Team.
            adSlot: 'pubmatic_test2',            // optional, must be a string, not an integer or other js type.
            pmzoneid: 'zone1, zone11',           // optional
            lat: '40.712775',                    // optional
            lon: '-74.005973',                   // optional
            yob: '1982',                         // optional
            kadpageurl: 'www.test.com',          // optional
            gender: 'M',                         // optional
            kadfloor: '0.50',                    // optional
            currency: 'AUD',                     // optional (Value configured only in the 1st adunit will be passed on. < br/> Values if present in subsequent adunits, will be ignored.)
            dctr: 'key1=123|key2=345',            // optional (Value configured only in the 1st adunit will be passed on. < br/> Values if present in subsequent adunits, will be ignored.)
            bcat: ['IAB1-5', 'IAB1-7'],                // Optional: Blocked IAB Categories. (Values from all slots will be combined and only unique values will be passed. An array of strings only. Each category should be a string of a length of more than 3 characters.)
            deals: ['deal-id-1', 'deal-id-200']   // optional: PMP Deals, should be array of strings
          }
        }]
      }
    ];

    var pbjs = pbjs || {};
    pbjs.que = pbjs.que || [];
  </script>
  <script src="../../build/dev/prebid.js" async></script>

  <script>
    function getHashedEmail() { }
    var googletag = googletag || {};
    googletag.cmd = googletag.cmd || [];
    googletag.cmd.push(function () {
      googletag.pubads().disableInitialLoad();
    });

    pbjs.que.push(function () {
      pbjs.setConfig({
        "debug": true,
        "userSync": {
          "userIds": [
            {
              "name": "imuid",
              "params": {
                "cid": 5126 // Set your Intimate Merger Customer ID here for production
              }
            },
          ],
          "syncDelay": 5000,
          "auctionDelay": 1000
        }
      });
      pbjs.addAdUnits(adUnits);
      pbjs.requestBids({
        bidsBackHandler: sendAdserverRequest
      });
    });

    function sendAdserverRequest() {
      if (pbjs.adserverRequestSent) return;
      pbjs.adserverRequestSent = true;
      googletag.cmd.push(function () {
        pbjs.que.push(function () {
          pbjs.setTargetingForGPTAsync();
          googletag.pubads().refresh();
        });
      });
    }

    setTimeout(function () {
      sendAdserverRequest();
    }, FAILSAFE_TIMEOUT);
  </script>

  <script>
    (function () {
      var gads = document.createElement('script');
      gads.async = true;
      gads.type = 'text/javascript';
      gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
      var node = document.getElementsByTagName('script')[0];
      node.parentNode.insertBefore(gads, node);
    })();
  </script>

  <script>
    googletag.cmd.push(function () {
      googletag.defineSlot('/112115922/FL_PB_MedRect', [[300, 250], [300, 600], [728, 90]], 'test-div').addService(googletag.pubads());
      googletag.pubads().enableSingleRequest();
      googletag.enableServices();
    });
  </script>
</head>

<body>
  <h2>User ID Modules Example</h2>

  <h4>Generated EIDs</h4>
  <script>
    pbjs.que.push(function () {
      var idsDiv = document.getElementById('ids-div');
      idsDiv.innerHTML = JSON.stringify(pbjs.getUserIdsAsEids(), null, ' ');
    });
  </script>
  <pre id="ids-div" style="border:1px solid #333; padding:5px; overflow: scroll"></pre>

  <h4>Ad Slot</h4>
  <div id="test-div" style="border:1px solid #333; padding:5px;">
    <script>
      googletag.cmd.push(function () { googletag.display('test-div'); });
    </script>
  </div>
</body>

</html>

@eknis
Copy link
Member

eknis commented Jun 4, 2025

lgtm

Copy link
Member

@fecker fecker left a comment

Choose a reason for hiding this comment

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

基本的にLGTM(ですが、Beacon作るまでちょっとまってね)
query parameter の build だけちょっと確認をお願いします。

Comment on lines +61 to +65
const baseUrl = url ? `${url}?cid=${cid}&` : `https://${apiDomain}/${cid}/pid?`;
const refererInfo = getRefererInfo();
return baseUrl +
`page=${encodeURIComponent(refererInfo.page || '')}` +
`&ref=${encodeURIComponent(refererInfo.ref || '')}`;
Copy link
Member

Choose a reason for hiding this comment

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

細かいのですが page が空なときに &&ref とか ?&ref になっちゃってカッコ悪いなぁと思ってしまい・・

Copy link
Author

Choose a reason for hiding this comment

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

@fecker san

細かいのですが page が空なときに &&ref とか ?&ref になっちゃってカッコ悪いなぁと思ってしまい・・

page が空の時には ?page=&ref=xxxx って感じになりますね(記号だけ残る感じにはならないです!)
page= のところも消したい感じですかね?

Copy link
Member

Choose a reason for hiding this comment

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

あー、ボケてますね・・・
できればパラメータごと消したかったのですが、特にこれなら問題ないかなと思ったのでいっちゃいましょう。

Copy link
Member

@fecker fecker left a comment

Choose a reason for hiding this comment

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

LGTM

本体に出すときの理由が悩ましいのですが、
・利用状況をモニタ
・IDを推定するデータソース
みたいな形でお願いします〜

@april418
Copy link
Author

@fecker san

本体に出すときの理由が悩ましいのですが、
・利用状況をモニタ
・IDを推定するデータソース
みたいな形でお願いします〜

プルリクの概要にこんな感じで書こうと思ってます!

  • Pass some parameters from getRefererInfo when getting ID from API.
    • Used as a datasource to infer IDs.
  • Fixed some code formatting.

eknis pushed a commit that referenced this pull request Aug 25, 2025
…ebid 10 (prebid#13194)

* collect EIDs for bid request

* add ad slot positioning to payload

* RPO-2012: Update local storage name-spacing for c_uid (#8)

* Updates c_uid namespacing to be more specific for concert

* fixes unit tests

* remove console.log

* RPO-2012: Add check for shared id (#9)

* Adds check for sharedId

* Updates cookie name

* remove trailing comma

* [RPO-3152] Enable Support for GPP Consent (#12)

* Adds gpp consent integration to concert bid adapter

* Update tests to check for gpp consent string param

* removes user sync endpoint and tests

* updates comment

* cleans up consentAllowsPpid function

* comment fix

* rename variables for clarity

* fixes conditional logic for consent allows function (#13)

* [RPO-3262] Update getUid function to check for pubcid and sharedid (#14)

* Update getUid function to check for pubcid and sharedid

* updates adapter version

* [RPO-3405] Add browserLanguage to request meta object

* ConcertBidAdapter: Add TDID (#20)

* Add tdid to meta object

* Fix null handling and add tests

* Concert Bid Adapter: Add dealId Property to Bid Responses (#22)

* adds dealid property to bid responses

* updates tests

* use first bid for tests

* adds dealid at the correct level

* [RPO-4220] Removes Access to Deprecated userId Object (#23)

* extracts eids

* cleanup

* updates tests and fixes typo

* fix type defs

* use single quotes

* remove whitespace

* bumps adapter version

* removes formatting change

---------

Co-authored-by: antoin <antoin.campbell@voxmedia.com>
Co-authored-by: Antoin <antoinfive@gmail.com>
Co-authored-by: Sam Ghitelman <sam.ghitelman@voxmedia.com>
Co-authored-by: Sam Ghitelman <SGhitelman@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants