-
Notifications
You must be signed in to change notification settings - Fork 85
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
onboarding clevertap #219
onboarding clevertap #219
Conversation
integrations/Clevertap/browser.js
Outdated
? "https://d2r1yp2w7bby2u.cloudfront.net/js/a.js" | ||
: "http://static.clevertap.com/js/a.js"; | ||
|
||
ScriptLoader("clevertap-integration", sourceUrl); |
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.
let's do this after the below part.
though same thing but still :)
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.
done
integrations/Clevertap/browser.js
Outdated
|
||
isLoaded() { | ||
logger.debug("in clevertap isLoaded"); | ||
return !!window.clevertap && window.clevertap.logout !== "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.
"undefined" --> 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.
This is fixed
logger.debug("in clevertap identify"); | ||
|
||
const { message } = rudderElement; | ||
if (!(message.context && message.context.traits)) { |
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.
is payload with only identity invalid?
i.e not traits but only userId/anonymousId?
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.
logger.debug(`Error occured at extractCustomFields ${err}`); | ||
} | ||
|
||
window.clevertap.onUserLogin.push({ |
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.
should we use the window.clevertap.profile.push ? not sure I think onUserLogin is what is documented.
still check once
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.
think something to do. with the clevertap native sdk behaviour we observed
integrations/Clevertap/browser.js
Outdated
logger.debug("in clevertap track"); | ||
const { event, properties } = rudderElement.message; | ||
if (properties) { | ||
window.clevertap.event.push(event, properties); |
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.
try sending inner objects or arrays. check if that as property is supported
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.
this is only supported in charged events we should use a validator for other events for checking if arrays or objects are are present
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.
Added validator
utils/utils.js
Outdated
* To check if a variable is storing object or not | ||
*/ | ||
const isObject = (obj) => { | ||
return Object.prototype.toString.call(obj) === '[object Object]'; |
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.
let's use the type method present in the utils
utils/utils.js
Outdated
* To check if a variable is storing object or not | ||
*/ | ||
const isArray = (obj) => { | ||
return Object.prototype.toString.call(obj) === '[object Array]'; |
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.
same as above
Description of the change
Type of change
Related issues
Checklists
Development
Code review
This change is