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

Load omniture library via launch breaking

Avatar

Avatar
Validate 1
Level 4
susheel
Level 4

Likes

60 likes

Total Posts

109 posts

Correct Reply

17 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 4
susheel
Level 4

Likes

60 likes

Total Posts

109 posts

Correct Reply

17 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
susheel
Level 4

09-01-2019

I am trying to load Adobe Visitor API for JavaScript version: 1.7.0 via Adobe Launch rule but the code is coming out of script tag after certain code.

<script>somecode</script>

remaining code coming out of script tag

Not sure why its happening.

any better way to load libraries ??

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Seeker
Employee
brandon_pack
Employee

Likes

30 likes

Total Posts

40 posts

Correct Reply

10 solutions
Top badges earned
Seeker
Unlock
Publish 1
Ignite 1
Give Back 3
View profile

Avatar
Seeker
Employee
brandon_pack
Employee

Likes

30 likes

Total Posts

40 posts

Correct Reply

10 solutions
Top badges earned
Seeker
Unlock
Publish 1
Ignite 1
Give Back 3
View profile
brandon_pack
Employee

10-01-2019

Thanks for the additional info.  Version 1.7.0 of VisitorAPI.js is really old and no longer supported since we are at version 3.3.0 as of today.  I would recommend upgrading to a newer library and ideally use the built in Launch Extension for "Experience Cloud ID Service."  Then you can just use Launch to keep it up to date goting forward.  However if your use case does not allow for that, you should still be able to create a "Custom Code" action in a Launch rule.  Just choose "HTML" as your lanuage and then click on "Open Editor" and just include the script tags you need.

CustomRule-1.png

In your example above, the test variable would just be a String however and not actually load the external library unless you append it to the DOM or do something with it.  But if that's what you want to have happen, then just escape the closing slash and Launch should not have any syntax errors.  This worked for me:

<script>

    var test  = '<script src="/js/VisitorAPI_1_7_0.js"><\/script>';

    var test1 = 'adasd';

</script>

Console output:

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 4
susheel
Level 4

Likes

60 likes

Total Posts

109 posts

Correct Reply

17 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 4
susheel
Level 4

Likes

60 likes

Total Posts

109 posts

Correct Reply

17 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
susheel
Level 4

11-01-2019

That was just an example script to explain the issue.

Avatar

Avatar
Validate 1
Level 4
susheel
Level 4

Likes

60 likes

Total Posts

109 posts

Correct Reply

17 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 4
susheel
Level 4

Likes

60 likes

Total Posts

109 posts

Correct Reply

17 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
susheel
Level 4

10-01-2019

I am not using the experience cloud id service. I am just loading it a java script via rules as that is how it was done in signal previously. The actual issue is:

For example if the javascript is as below.

<script>

    var test = '<script src=""><\script>';

    var test1="adasd";

</script>

Browser will treat </script> in the second line as end of script spit out the rest on the browser directly as below.

<script>

    var test = '<script src="">

</script>

;var test1="adasd";

Somehow I tried to fix it by doing as below:

<script>

    var test = '<script src=""><\scr'+'ipt>';

    var test1="adasd";

</script>

The above code worked in normal browser but when I put the script via launch seems like the code is getting converted while build I suppose and getting same issue again.

Avatar

Avatar
Seeker
Employee
brandon_pack
Employee

Likes

30 likes

Total Posts

40 posts

Correct Reply

10 solutions
Top badges earned
Seeker
Unlock
Publish 1
Ignite 1
Give Back 3
View profile

Avatar
Seeker
Employee
brandon_pack
Employee

Likes

30 likes

Total Posts

40 posts

Correct Reply

10 solutions
Top badges earned
Seeker
Unlock
Publish 1
Ignite 1
Give Back 3
View profile
brandon_pack
Employee

09-01-2019

We will probably need more information to help out on this.  Info like whether you are using the built in "Experience Cloud ID Service" extension or if you are doing it manually.  Also if you can provide more details like maybe a link to the property where you are seeing this and maybe the Launch propery, it would be helpful.

Thanks