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

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
Shape 25
MVP
Andrey_Osadchuk
MVP

Likes

539 likes

Total Posts

973 posts

Correct reply

266 solutions
Top badges earned
Shape 25
Bedrock
Coach
Boost 500
Affirm 250
View profile

Avatar
Shape 25
MVP
Andrey_Osadchuk
MVP

Likes

539 likes

Total Posts

973 posts

Correct reply

266 solutions
Top badges earned
Shape 25
Bedrock
Coach
Boost 500
Affirm 250
View profile
Andrey_Osadchuk
MVP

14-02-2021

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