Expand my Community achievements bar.

SOLVED

Uncaught (in promise) ReferenceError: s is not defined

Avatar

Level 1

zhefengzo_1-1691657626030.png

The error came from here. s is not defined

 

zhefengzo_0-1691657579699.png

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

What is that first image of?

 

 

s.eVar5 = window.Yo ? Yo.rum.get().optState : 'yo-not-present'; 

 

 

Is this the code inside your Data Element "Yottaa_Performance_Monitoring (v5)"??

 

If so, the s object is not available inside of Data Elements, but this also is not how Data Elements work...

 

If you are setting an eVar to a Data Element:

Jennifer_Dungan_0-1691686625113.png

 

Then you shouldn't be trying to set the dimension inside that code... 

 

Data Elements set a value (using standard JS)

 

 

var MyVar = "something";
//or
var MyDataElement = _satellite.getVar('anotherElement');

// Do some manipulation, logic, etc here that results in "finalValue":
var finalValue = "X";

return finalValue;

 

 

That return passes whatever value your code creates (or "empty string" if the final result is null).

 

Then you set the Data Element into your dimensions in your tracking rules to take the value of the Data Element and set it where you want it....

 

View solution in original post

2 Replies

Avatar

Community Advisor

It could be that there is something that's blocking AA's AppMeasurement.js from being loaded properly in your page. Are you able to share the web page URL for us to preview and troubleshoot?

Avatar

Correct answer by
Community Advisor and Adobe Champion

What is that first image of?

 

 

s.eVar5 = window.Yo ? Yo.rum.get().optState : 'yo-not-present'; 

 

 

Is this the code inside your Data Element "Yottaa_Performance_Monitoring (v5)"??

 

If so, the s object is not available inside of Data Elements, but this also is not how Data Elements work...

 

If you are setting an eVar to a Data Element:

Jennifer_Dungan_0-1691686625113.png

 

Then you shouldn't be trying to set the dimension inside that code... 

 

Data Elements set a value (using standard JS)

 

 

var MyVar = "something";
//or
var MyDataElement = _satellite.getVar('anotherElement');

// Do some manipulation, logic, etc here that results in "finalValue":
var finalValue = "X";

return finalValue;

 

 

That return passes whatever value your code creates (or "empty string" if the final result is null).

 

Then you set the Data Element into your dimensions in your tracking rules to take the value of the Data Element and set it where you want it....