Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.

No Automatic Default Value for Data Elements Anymore

Avatar

Employee

8/10/20

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!

15 Comments

Avatar

Level 4

8/10/20

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

Employee

8/12/20

@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

Community Advisor

8/24/20

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

Employee

11/10/20

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

Avatar

Community Advisor

11/10/20

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

Level 1

4/13/21

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

Level 1

4/13/21

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

Employee

4/13/21

@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

Employee

4/13/21

@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

Level 3

5/20/21

@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

Employee

5/24/21

@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

Level 3

6/15/21

@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.

Avatar

Level 1

7/6/22

@thebenrobb Hi ,setting default value will resolve 'unspecified' in adobe analytic reports issue?

is there another solution for resolving 'unspecified' issue

Avatar

Community Advisor

7/6/22

@user06403 thebenrobb has left Adobe already.

Adobe Analytics reports "Unspecified" when the dimension that you're using did not have any value when the beacon was sent or, in the case of an eVar, when there is no value to persist from previous hits. https://experienceleague.adobe.com/docs/analytics/technotes/unspecified.html?lang=en

Setting a default value in Launch's data element may or may not solve your problem. Here's a simple example: Let's say you've configured Analytics to set prop3 from data element "my data element", but only when page name is "About". Furthermore, let's say that "my data element" has a default value "nothing".

Page View 1: page name = "Home", "my data element" does not evaluates to any value, so it defaults to "nothing" --> prop3 is not set in the s.t() Page View beacon because page name is not "About".

Page View 2: page name = "Contact", "my data element" evaluates to "success" --> prop3 is not set in the s.t() Page View beacon because page name is not "About", even though "my data element" has a proper value.

Page View 3: page name = "About", "my data element" evaluates to "success" --> prop3 is set with "success" in the s.t() Page View beacon because page name is "About" and "my data element" has a value.

Page View 4: page name = "About", but "my data element" evaluates to no value, so it defaults to "nothing" --> prop3 is set with the blank string "nothing" in the s.t() Page View beacon because page name is "About" and "my data element" gets set with its default value.

Notice that in the cases of Page Views 1 and 2, you will still end up with "Unspecified" in your prop3 report because in this example, prop3 would only get set with "About" page.

So, setting a data element's default value is not a "magic bullet" for eliminating "Unspecified" from Adobe Analytics. You also must look at your implementation to determine how the data element is used.