내 커뮤니티 업적 표시줄을 확대합니다.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

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

Avatar

Level 1

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

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Employee

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

원본 게시물의 솔루션 보기

4 답변 개

Avatar

Employee

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

Avatar

Level 1

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

Avatar

정확한 답변 작성자:
Employee

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

Avatar

Level 10

Hi luizam67085634 ,

Did you get a resolution to your query?

Thanks,

Gaurang