Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Data Element Works only with return Statement

Avatar

Avatar
Level 1
Gianluca
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
Gianluca
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
Gianluca
Level 1

11-02-2021

Hi all,

in Adobe Launch I have defined a data element that should be set with a javascript variable on source page of the website.

When I call on browser console _satellite.getVar('MY VAR') it returns null, even if the javascript variable is defined and populated.

After several tests it seems that I can retrieve my data element value only defining it as a custom code type with a return statement like this:

 

if(MY JAVASCRIPT VARIABLE)

 return MY JAVASCRIPT VARIABLE;

else

return ""

May someone help me understand why?

 

Thank you 

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Springboard
MVP
yuhuisg
MVP

Likes

152 likes

Total Posts

479 posts

Correct Reply

90 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Establish
Contributor
View profile

Avatar
Springboard
MVP
yuhuisg
MVP

Likes

152 likes

Total Posts

479 posts

Correct Reply

90 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Establish
Contributor
View profile
yuhuisg
MVP

19-02-2021

Just to confirm: inside Adobe Launch, you have setup a Data Element from Core > JavaScript Variable, and you've specified the name of your JavaScript variable in that data element's configuration, right?

Screenshot 2021-02-19 at 6.20.51 PM.png

Avatar

Avatar
Coach
MVP
Andrey_Osadchuk
MVP

Likes

510 likes

Total Posts

917 posts

Correct Reply

243 solutions
Top badges earned
Coach
Contributor
Seeker
Bedrock
Boost 500
View profile

Avatar
Coach
MVP
Andrey_Osadchuk
MVP

Likes

510 likes

Total Posts

917 posts

Correct Reply

243 solutions
Top badges earned
Coach
Contributor
Seeker
Bedrock
Boost 500
View profile
Andrey_Osadchuk
MVP

14-02-2021

Yes, this is how it's designed. What was your expectation?