No Automatic Default Value for Data Elements Anymore

Avatar

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile
thebenrobb
Employee

10-08-2020

On September 1, 2020, we tweaked the way that data element default values are set. Newly created data elements will no longer have a default value set automatically. Today I want to explain what the default values are for, why we're making the change, and explain the specifics of the change.

Data Element Default Value Usage

For the purposes of this conversation, we'll define "data element" to be a pointer to data that will exist inside the client environment at run-time.  "Data element value" or simply "value" refers to the actual value that the data element points to or "resolves" to at run-time.

Data elements can be used within events, conditions, actions, extension configurations, and even other data elements.  At runtime, the data element is resolved at the time that it is needed.  For example, you have a rule with a data element reference inside an action.  The rule's event is triggered, the conditions are evaluated, and so now we have to run the action.  Launch will resolve the value of the data element, then hand that value to the action so that the action can be run.

If the data element resolves to null or undefined, the first fallback is to a stored value based on the storage duration of the data element.  If there is no stored value, then the second fallback is to the default value.

Jim Gordon (of Jimalytics) made this decision flow that describes data element usage.  The only change I'd make is to change the word "reset" to "resolve" in the 1st rectangle - and only to make the wording consistent with this article.

image.png

Today, the default value for a data element is an empty string ('').  It will stay this way unless you provide a different string.

Reason for the Change

The Adobe Experience Edge Network is coming online.  We are super excited about it and we want people to check it out.  That service requires usage of the Experience Data Model (XDM) which is a defined schema that you use to assign meaning to your data.

Setting an empty string value in your XDM object can cause negative downstream effects.  We want to make sure that if you're setting empty strings that you're doing it because you wanted to - not just because that is the default Launch option.

What Changed?

Data elements have a field for a Default Value available in the left rail.  Previously, all new data elements were automatically given a Default Value of an empty string ('').  If you didn't want that, your other option was to provide a different string.

data-element-default-value-old.png

At the API level, the behavior was similar.  The attribute was optional and you were not required to set it.  If you provided a value, then Launch will save that value.  Otherwise the default value was an empty string.  You could not actually save a data element with no default value.

The change we made does not impact the settings or behavior of any existing data elements.  It only applies to the automatically assigned default value on newly created data elements.

Instead of automatically assigning an empty string as the default value, Launch will now have no default value.

Once the change is made, if you want your data elements to have a default value, you'll need to select a checkbox labeled "Enable default value".  From there, you can:

  1. Leave the field blank to get the old behavior of an empty string
  2. Fill in whatever default value you want

If you leave the checkbox unselected, your data element have no default value.

data-element-default-value.png

Previously saved data elements with the empty string will now show in the UI as in the picture above with "Enable default value" selected and no value in the text field.

The API change is similar in nature.  The attribute is still optional and you are not required to set it.  If you do not provide a value, Launch will now save your data element with no default value - where before it would have been saved with an empty string.  If you actually want to save your data element default value as an empty string, you must now provide the attribute and explicitly set it as an empty string ('').

So What?

So what does this mean for you?  Most probably nothing.  All your existing data elements will retain the exact behavior that they have now.

We have also verified that there are no negative affects to your Analytics reports.  If you have an eVar or a prop referencing a data element that resolves to null or undefined, these will not show up as "null" or "undefined" strings in your beacons.

The only case where your process may need to change from what you're doing now is if you create a new data element and you specifically need the default value to be an empty string.  If this describes you, then in the UI you will have an extra checkbox to select.  With the API, you'll need to pass the default_value attribute now, where before you could have left it blank.

This change was made on September 1, 2020.  Sound off in the comments below if you have any questions.

Happy tagging!

13 Comments

Avatar

Avatar
Validate 10
Level 4
jorisdebeer
Level 4

Likes

36 likes

Total Posts

58 posts

Correct reply

9 solutions
Top badges earned
Validate 10
Validate 1
Contributor
Seeker
Shape 1
View profile

Avatar
Validate 10
Level 4
jorisdebeer
Level 4

Likes

36 likes

Total Posts

58 posts

Correct reply

9 solutions
Top badges earned
Validate 10
Validate 1
Contributor
Seeker
Shape 1
View profile
jorisdebeer
Level 4

10-08-2020

Hi Rob,

 

What are the benefits of having data elements return null ?

 

And does this mean that new data elements that don't set a default value and are used by a variable in the Adobe Analytics set variables action may track as "null". Will we see the string "null" in Adobe Workspace if we don't set a default value of ""?

 

Lastly, how does this effect tests for undefined. I've seen lots of conditional logic (for better or worse) that looks like:

var utmMedium = _satellite.getVar('utm_medium');
if(typeof utmMedium === 'undefined'){ // do stuff };

Avatar

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile
thebenrobb
Employee

12-08-2020

@jorisdebeer, your question makes it clear to me that I didn't explain very well above.  I've reworded some of the sections to provide more clarity.   Data element default values will not actually be nullnull is just how we're storing the value in the database.  The actual runtime behavior is that there is no default value.

For Analytics specifically, we consider a row in your report that says "null" to be a non-starter.  This has been tested carefully.  If you have evar5 set with %data-element-a%, then following the logic above, we'll attempt to resolve the value of data-element-a and provide it.  If it resolves to null or undefined, we'll fall back to the stored value based on data-element-a's Storage duration.  Then we'll fall back to the default value.  If there is no default value, then we just won't provide one, but we will not ever provide null as the value of the data element.

For your last question, if the utm_medium data element resolves to undefined and it has no default value, then the value returned by _satellite.getVar will also be undefined.

Avatar

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

203 likes

Total Posts

608 posts

Correct reply

125 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

203 likes

Total Posts

608 posts

Correct reply

125 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile
yuhuisg
MVP

24-08-2020

Suggestion: in the "Default Value" input field, include a small message or tooltip that says something like "leave this blank to use a blank string". Otherwise, people who are none the wiser might enter "" (literally, double quote-double quote) as the default value, thinking that that returns a blank string, when it will return the string "", i.e. 2 double quotes.

Avatar

Avatar
Validate 1
Level 1
colek93887464
Level 1

Like

1 like

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Engage 1
Boost 1
View profile

Avatar
Validate 1
Level 1
colek93887464
Level 1

Like

1 like

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Engage 1
Boost 1
View profile
colek93887464
Level 1

05-11-2020

 -

Avatar

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile
thebenrobb
Employee

10-11-2020

@yuhuisg, based on the suggestion, I'm guessing you hadn't seen that in the tooltip? 

Avatar

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

203 likes

Total Posts

608 posts

Correct reply

125 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

203 likes

Total Posts

608 posts

Correct reply

125 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile
yuhuisg
MVP

10-11-2020

Screenshot 2020-11-11 at 1.03.44 AM.png

@thebenrobb if you were referring to this tooltip that appears when you mouseover the "i", then this is probably the first time I've noticed it. Thanks for pointing it out!

Avatar

Avatar
Engage 1
Level 1
kf920502
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Engage 1
Boost 1
View profile

Avatar
Engage 1
Level 1
kf920502
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Engage 1
Boost 1
View profile
kf920502
Level 1

13-04-2021

Hi, 

 

I have a default value set in my data element but the  '_satellite.getVar('data element')' is returning undefined in the console. Are you aware of what this could be?

Avatar

Avatar
Engage 1
Level 1
cknast
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Engage 1
View profile

Avatar
Engage 1
Level 1
cknast
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Engage 1
View profile
cknast
Level 1

13-04-2021

hi quick question - why aren't default values used whenever a data element returns an empty string (ex. reference datalayer property that has empty string & data element returns it)? I was expecting any falsy javascript value to use the default value but appears from the above thread that only null & undefined resolve to default value?

Avatar

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile
thebenrobb
Employee

13-04-2021

@cknast, we have many customers for whom an empty string is a valid value for a data element, so we didn't want to overwrite those with different default values.  I think the reasons for that are often tied up in backward compatibility with existing implementations, but it is the situation we are in.

Avatar

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile
thebenrobb
Employee

13-04-2021

@kf920502, my recollection is that data elements return `undefined` when they are not defined on the `_satellite` object.  Meaning, we don't even recognize the name you've given as a valid data element.  I'd check spacing and capitalization first, then check build dates on your _satellite object to make sure you've actually built the library with the data element in it. 

Avatar

Avatar
Springboard
Level 2
james-mke
Level 2

Likes

2 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Springboard
Establish
Seeker
Engage 1
Validate 1
View profile

Avatar
Springboard
Level 2
james-mke
Level 2

Likes

2 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Springboard
Establish
Seeker
Engage 1
Validate 1
View profile
james-mke
Level 2

20-05-2021

@thebenrobb  You have posted some helpful information about populating data elements with default values through Adobe Launch.

 

I have followed the discussions and believed to have applied all of the necessary settings but we are not seeing the default values set in Google Analytics. When viewing the data element in console with _satellite I am seeing "" as a result, but not getting the default value that is set in Launch. 

james-mke_1-1621530407485.png

 

 

james-mke_0-1621530358503.png

Based on what you see here is there anything that could be missing or something else that I need to create or modify to make this work?

 

Thank you!

Avatar

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile
thebenrobb
Employee

24-05-2021

@james-mke, normally when you reference a data element that has not been defined, you'll actually get undefined.  I believe the property setting that you've enabled for "Return an empty string for missing data elements" overwrites this default behavior, and instead of getting undefined, you'll get an empty string.

So my best guess (based on current info) is that you haven't actually included JavaScript Variable data element type (in your screenshot) in the library that you're testing.  So when you reference the data element, it's not actually there, but your property setting is converting it into an empty string.

If this is correct, then the resolution would be to include the data element in the library that you're testing.  Once you've done that, referencing that data element in the console should give you your correct value - if there is one - or your default value.

Avatar

Avatar
Springboard
Level 2
james-mke
Level 2

Likes

2 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Springboard
Establish
Seeker
Engage 1
Validate 1
View profile

Avatar
Springboard
Level 2
james-mke
Level 2

Likes

2 likes

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Springboard
Establish
Seeker
Engage 1
Validate 1
View profile
james-mke
Level 2

15-06-2021

@thebenrobb - Thank you for your feedback. We discovered that the issue was related to our datalayer and not the Launch code. The trick for anyone else having difficulty with this is to ensure that the Push method for creating a data layer is used as that will update the default value in the data layer. This the direct method data layer creation does not allow for Adobe Launch to change the value.