How to implement AA script tag in a React JS project?

Avatar

Avatar
Validate 1
Level 1
luizam67085634
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
luizam67085634
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
luizam67085634
Level 1

24-07-2018

Hello,

I have a huge Adobe Audience <script> tag and I have to insert it into a React JS project.

I was instructed to insert it in <head> tag, but I am trying to avoid inserting it in my index.html file because I feel it's not the best practice to put

a lot of code in it. I am wondering if there is a way to work around this and inserting this script tag with an approach that is more React-like.

Thank you very much

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Publish 1
Employee
harishd90
Employee

Likes

17 likes

Total Posts

24 posts

Correct reply

14 solutions
Top badges earned
Publish 1
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Publish 1
Employee
harishd90
Employee

Likes

17 likes

Total Posts

24 posts

Correct reply

14 solutions
Top badges earned
Publish 1
Validate 1
Boost 5
Boost 3
Boost 10
View profile
harishd90
Employee

26-07-2018

Hi,

In that case, you could place the AAM script at the location where you have your other JS libraries and call it using script src tag. Additionally, if could you elaborate the usecase for this script that you're trying to add, we may be able to come up with more options.

Regards,

Harish

Answers (3)

Answers (3)

Avatar

Avatar
Springboard
Level 9
Gaurang
Level 9

Likes

144 likes

Total Posts

435 posts

Correct reply

45 solutions
Top badges earned
Springboard
Validate 100
Validate 50
Validate 25
Validate 10
View profile

Avatar
Springboard
Level 9
Gaurang
Level 9

Likes

144 likes

Total Posts

435 posts

Correct reply

45 solutions
Top badges earned
Springboard
Validate 100
Validate 50
Validate 25
Validate 10
View profile
Gaurang
Level 9

26-09-2018

Hi luizam67085634 ,

Did you get a resolution to your query?

Thanks,

Gaurang

Avatar

Avatar
Validate 1
Level 1
luizam67085634
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
luizam67085634
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
luizam67085634
Level 1

25-07-2018

Unfortunately, a tag manager is not an option in this case. The client doesn't allow because of its area of business.

Avatar

Avatar
Publish 1
Employee
harishd90
Employee

Likes

17 likes

Total Posts

24 posts

Correct reply

14 solutions
Top badges earned
Publish 1
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Publish 1
Employee
harishd90
Employee

Likes

17 likes

Total Posts

24 posts

Correct reply

14 solutions
Top badges earned
Publish 1
Validate 1
Boost 5
Boost 3
Boost 10
View profile
harishd90
Employee

25-07-2018

Hi luizam67085634 ,

You could use a tag manager, such as DTM, Google, etc. to host the script and call it in your head section; or you can add call the script using script source tag, again in your head section.

Using a tag manager is recommended as you don't have to edit your site code every time you have to make changes/add/remove multiple scripts.

Regards,

Harish