-
Notifications
You must be signed in to change notification settings - Fork 237
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
Convert undefined to blank in customDimensions? #1471
Comments
v2.7.0 is not fully deployed to NPM and all CDN endpoints |
Thanks for including this! |
It may take up to around 30 minutes for all CDN endpoints to pick up the new bits (depending where you are located) |
I finally have had a chance to test this with 2.7.2 and I'm still seeing values listed as "undefined" in customDimensions. Is there a trick to making this work? I found the parameter in the config where I set { convertUndefined: '' }. I added this and have several parameters that wrote undefined properties into the customDimensions of a pageView. However, it still shows 'undefined' in customDimensions in Application Insights. |
Reopened so we can investigate further @Karlie-777 do you have some cycles to investigate this see the PR #1630 to see what was changed |
Hi @coreyroth
|
Hi @Karlie-777, perfect. That's my understanding as well. Using v2.7.2. I initialize my instance with something like:
Then I am writing undefined versus 'undefined' into my objects. Here's the browser output of some of my object before I call trackPageView().
Here's what I am seeing in Application Insights: |
Hi @coreyroth |
Hi @Karlie-777. I just validated and neither of those are working for me. Does it work for all of the various methods in the SDK? In this case, I was testing trackPageView(). |
Hi @coreyroth |
Hi @Karlie-777, Interesting. So the track network requests are showing as "undefined" in the Payload using quotes. That's definitely not how I am writing the values in though as I showed in the screenshot earlier. I definitely could be doing something wrong but I'm not sure what. |
Hi @coreyroth, |
Is your feature request related to a problem? Please describe.
I have a number of customDimensions in trackPageView, trackEvent, etc. Given this SDK is JavaScript based, dealing with undefined is a common thing. When we send a value of undefined, it shows up in our data model as undefined as well. I'm then reading the data through the API or Power BI and undefined. That doesn't look good on reports and we have to do comparisons to both '' and undefined.
I can work around this easily enough, but it's a bit of a mess when I am sending 50+ properties in an event. Does it make sense for the SDK to strip undefined and send '' instead of undefined?
Describe the solution you'd like
I would like the SDK or the API to convert undefined to a blank ('') value so it doesn't show up in the data model. This could be an option on the SDK perhaps in case people don't want this behavior.
Describe alternatives you've considered
I can work around this of course by wrapping the values I am sending with a function to detect undefined. I could also use a telemetryInitializer to work around it as well.
The text was updated successfully, but these errors were encountered: