-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Intentiq id value change #5746
Intentiq id value change #5746
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question about handling legacy values
modules/intentIqIdSystem.js
Outdated
return (value && typeof value['ctrid'] === 'string') ? { 'intentIqId': value['ctrid'] } : undefined; | ||
}, | ||
/** | ||
* performs action to obtain id and return a value in the callback's response argument | ||
* @function | ||
* @param {SubmoduleParams} [configParams] | ||
* @returns {IdResponse|undefined} | ||
*/ | ||
getId(configParams) { | ||
if (!configParams || typeof configParams.partner !== 'number') { | ||
utils.logError('User ID - intentIqId submodule requires a valid partner to be defined'); | ||
return; | ||
} | ||
|
||
// use protocol relative urls for http or https | ||
const url = `https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=${configParams.partner}&pt=17&dpn=1`; | ||
const resp = function (callback) { | ||
const callbacks = { | ||
success: response => { | ||
let responseObj; | ||
if (response) { | ||
try { | ||
responseObj = JSON.parse(response); | ||
} catch (error) { | ||
utils.logError(error); | ||
} | ||
} | ||
callback(responseObj); | ||
}, | ||
error: error => { | ||
utils.logError(`${MODULE_NAME}: ID fetch encountered an error`, error); | ||
callback(); | ||
} | ||
}; | ||
ajax(url, callbacks, undefined, {method: 'GET', withCredentials: true}); | ||
}; | ||
return {callback: resp}; | ||
} | ||
}; | ||
|
||
submodule('userId', intentIqIdSubmodule); | ||
/** | ||
* This module adds IntentIqId to the User ID module | ||
* The {@link module:modules/userId} module is required | ||
* @module modules/intentIqIdSystem | ||
* @requires module:modules/userId | ||
*/ | ||
|
||
import * as utils from '../src/utils.js' | ||
import {ajax} from '../src/ajax.js'; | ||
import {submodule} from '../src/hook.js' | ||
|
||
const MODULE_NAME = 'intentIqId'; | ||
|
||
/** @type {Submodule} */ | ||
export const intentIqIdSubmodule = { | ||
/** | ||
* used to link submodule with config | ||
* @type {string} | ||
*/ | ||
name: MODULE_NAME, | ||
/** | ||
* decode the stored id value for passing to bid requests | ||
* @function | ||
* @param {{string}} value | ||
* @returns {{intentIqId:string}} | ||
*/ | ||
decode(value) { | ||
return (value != undefined && value != '') ? { 'intentIqId': value } : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this properly handle legacy values that are already stored in cache? it looks like for all users that hit a page with this new code, until a getId
call is made again, you will lose the old value of the ID, which seems like it could be bad. Is that how this would work and is that intentional?
Yes, we are currently only testing Prebid with one partner so there isn't
much data to lose, even though my intention was that the cache would get
overwritten fast.
Is there any change to be made to make the getId call happen more often
until all the cache values are changed to the new one?
Besides, It is my understanding that we previously saved only the id string
into the cache and not the HTTP response so using a plain string id
shouldn't be any different.
…On Tue, Sep 15, 2020 at 12:35 PM Scott ***@***.***> wrote:
***@***.**** commented on this pull request.
question about handling legacy values
------------------------------
In modules/intentIqIdSystem.js
<#5746 (comment)>:
> - return (value && typeof value['ctrid'] === 'string') ? { 'intentIqId': value['ctrid'] } : undefined;
- },
- /**
- * performs action to obtain id and return a value in the callback's response argument
- * @function
- * @param {SubmoduleParams} [configParams]
- * @returns {IdResponse|undefined}
- */
- getId(configParams) {
- if (!configParams || typeof configParams.partner !== 'number') {
- utils.logError('User ID - intentIqId submodule requires a valid partner to be defined');
- return;
- }
-
- // use protocol relative urls for http or https
- const url = `https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=${configParams.partner}&pt=17&dpn=1` <https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=$%7BconfigParams.partner%7D&pt=17&dpn=1>;
- const resp = function (callback) {
- const callbacks = {
- success: response => {
- let responseObj;
- if (response) {
- try {
- responseObj = JSON.parse(response);
- } catch (error) {
- utils.logError(error);
- }
- }
- callback(responseObj);
- },
- error: error => {
- utils.logError(`${MODULE_NAME}: ID fetch encountered an error`, error);
- callback();
- }
- };
- ajax(url, callbacks, undefined, {method: 'GET', withCredentials: true});
- };
- return {callback: resp};
- }
-};
-
-submodule('userId', intentIqIdSubmodule);
+/**
+ * This module adds IntentIqId to the User ID module
+ * The ***@***.*** module:modules/userId} module is required
+ * @module modules/intentIqIdSystem
+ * @requires module:modules/userId
+ */
+
+import * as utils from '../src/utils.js'
+import {ajax} from '../src/ajax.js';
+import {submodule} from '../src/hook.js'
+
+const MODULE_NAME = 'intentIqId';
+
+/** @type {Submodule} */
+export const intentIqIdSubmodule = {
+ /**
+ * used to link submodule with config
+ * @type {string}
+ */
+ name: MODULE_NAME,
+ /**
+ * decode the stored id value for passing to bid requests
+ * @function
+ * @param {{string}} value
+ * @returns {{intentIqId:string}}
+ */
+ decode(value) {
+ return (value != undefined && value != '') ? { 'intentIqId': value } : undefined;
will this properly handle legacy values that are already stored in cache?
it looks like for all users that hit a page with this new code, until a
getId call is made again, you will lose the old value of the ID, which
seems like it could be bad. Is that how this would work and is that
intentional?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5746 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN2NVBRPNLLPEGEIZJOLT4DSF4YOHANCNFSM4RMZQGAA>
.
--
*Yuval Grinberg* | Software Engineer R&D
<https://www.intentiq.com/>
M: +972505236174
|
Yes, we are currently only testing Prebid with one partner so there isn't
much data to lose, even though my intention was that the cache would get
overwritten fast.
Is there any change to be made to make the getId call happen more often
until all the cache values are changed to the new one?
Besides, It is my understanding that we previously saved only the id string
into the cache and not the HTTP response so using a plain string id
shouldn't be any different.
*Can't comment on the PR itself mate
…On Tue, Sep 15, 2020 at 12:35 PM Scott ***@***.***> wrote:
***@***.**** commented on this pull request.
question about handling legacy values
------------------------------
In modules/intentIqIdSystem.js
<#5746 (comment)>:
> - return (value && typeof value['ctrid'] === 'string') ? { 'intentIqId': value['ctrid'] } : undefined;
- },
- /**
- * performs action to obtain id and return a value in the callback's response argument
- * @function
- * @param {SubmoduleParams} [configParams]
- * @returns {IdResponse|undefined}
- */
- getId(configParams) {
- if (!configParams || typeof configParams.partner !== 'number') {
- utils.logError('User ID - intentIqId submodule requires a valid partner to be defined');
- return;
- }
-
- // use protocol relative urls for http or https
- const url = `https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=${configParams.partner}&pt=17&dpn=1` <https://api.intentiq.com/profiles_engine/ProfilesEngineServlet?at=39&mi=10&dpi=$%7BconfigParams.partner%7D&pt=17&dpn=1>;
- const resp = function (callback) {
- const callbacks = {
- success: response => {
- let responseObj;
- if (response) {
- try {
- responseObj = JSON.parse(response);
- } catch (error) {
- utils.logError(error);
- }
- }
- callback(responseObj);
- },
- error: error => {
- utils.logError(`${MODULE_NAME}: ID fetch encountered an error`, error);
- callback();
- }
- };
- ajax(url, callbacks, undefined, {method: 'GET', withCredentials: true});
- };
- return {callback: resp};
- }
-};
-
-submodule('userId', intentIqIdSubmodule);
+/**
+ * This module adds IntentIqId to the User ID module
+ * The ***@***.*** module:modules/userId} module is required
+ * @module modules/intentIqIdSystem
+ * @requires module:modules/userId
+ */
+
+import * as utils from '../src/utils.js'
+import {ajax} from '../src/ajax.js';
+import {submodule} from '../src/hook.js'
+
+const MODULE_NAME = 'intentIqId';
+
+/** @type {Submodule} */
+export const intentIqIdSubmodule = {
+ /**
+ * used to link submodule with config
+ * @type {string}
+ */
+ name: MODULE_NAME,
+ /**
+ * decode the stored id value for passing to bid requests
+ * @function
+ * @param {{string}} value
+ * @returns {{intentIqId:string}}
+ */
+ decode(value) {
+ return (value != undefined && value != '') ? { 'intentIqId': value } : undefined;
will this properly handle legacy values that are already stored in cache?
it looks like for all users that hit a page with this new code, until a
getId call is made again, you will lose the old value of the ID, which
seems like it could be bad. Is that how this would work and is that
intentional?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5746 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN2NVBRPNLLPEGEIZJOLT4DSF4YOHANCNFSM4RMZQGAA>
.
--
*Yuval Grinberg* | Software Engineer R&D
<https://www.intentiq.com/>
M: +972505236174
|
Ok understood, as long as it's intended. If the publisher sets the |
once you get the CI failures fixed, this LGTM to be merged |
Can you please attach the failure details, when I'm running the tests
locally I don't get any issues and it seems like I don't have access to the
CircleCI GUI.
…On Tue, Sep 15, 2020 at 1:31 PM Scott ***@***.***> wrote:
once you get the CI failures fixed, this LGTM to be merged
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5746 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN2NVBUFVQRAQJHF5IA4IELSF47BLANCNFSM4RMZQGAA>
.
--
*Yuval Grinberg* | Software Engineer R&D
<https://www.intentiq.com/>
M: +972505236174
|
All the tests are now passing :) , can we continue with the merge?
…On Tue, Sep 15, 2020 at 1:33 PM Yuval Grinberg ***@***.***> wrote:
Can you please attach the failure details, when I'm running the tests
locally I don't get any issues and it seems like I don't have access to the
CircleCI GUI.
On Tue, Sep 15, 2020 at 1:31 PM Scott ***@***.***> wrote:
> once you get the CI failures fixed, this LGTM to be merged
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#5746 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AN2NVBUFVQRAQJHF5IA4IELSF47BLANCNFSM4RMZQGAA>
> .
>
--
*Yuval Grinberg* | Software Engineer R&D
<https://www.intentiq.com/>
M: +972505236174
--
*Yuval Grinberg* | Software Engineer R&D
<https://www.intentiq.com/>
M: +972505236174
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Type of change
Description of change
IntentIQ id will use plain id string instead of decoding a JSON value.
Be sure to test the integration with your adserver using the Hello World sample page.
For any changes that affect user-facing APIs or example code documented on http://prebid.org, please provide:
Other information