No Automatic Default Value for Data Elements Anymore

Avatar

Avatar

thebenrobb

Employee

Avatar

thebenrobb

Employee

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!

6 Comments

Avatar

Avatar

jorisdebeer

Avatar

jorisdebeer

jorisdebeer

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

thebenrobb

Employee

Avatar

thebenrobb

Employee

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

yuhuisg

Avatar

yuhuisg

yuhuisg

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

colek93887464

Avatar

colek93887464

colek93887464

05-11-2020

 -

Avatar

Avatar

thebenrobb

Employee

Avatar

thebenrobb

Employee

thebenrobb
Employee

10-11-2020

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

Avatar

Avatar

yuhuisg

Avatar

yuhuisg

yuhuisg

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!