Skip to main content
Level 3
Aug 3, 2022 2:38 PM UTC
Solved

at.js 2.x TriggerView - Possible to Add Custom JS Code via VEC

Hello,

I have implemented the triggerView functionality on my organization's SPA. I can add CSS, basic HTML, and other changes to a particular view in the VEC. However, I have not been able to successfully add Custom Code (specifically a JS script); the script simply does not execute. I have tried multiple combinations: adding to head/not adding to head, various scripts including simple console.logs, etc. To be clear, I am very familiar with adding custom JS to "normal" (not using triggerView()) Experiences to through the VEC, even to the same SPA that is not working with the triggerViews.

 

Is this a known issue? Specifically, is it even possible to add custom JS to a particular view via the VEC? If not, any suggestions as to what may be going wrong?

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Amelia_Waliany
Amelia_WalianyAccepted solution
Adobe Employee
Feb 13, 2023 9:21 PM UTC

[8.31.22 Adobe Target Community Q&A Coffee Break Answer provided by @moses_maxen: 

----------------------------

Hi @KMarchewa - thank you for your question.  We recommend opening a support ticket for this in case you are still facing trouble with delivering custom code through a particular view.  Thank you!

----------------------------

Check out the entire 8.31.22 Adobe Target Community Q&A Coffee Break discussion thread for more insights on related topics 🙂 

 

3 replies

Level 2
Aug 4, 2022 7:08 AM UTC

Hi @kmarchewa , 

 

just to understand your problem correct. You can add HTML and it works, but if you within the HTML add Javascript like this via a script tag is does not execute?

<script> console.log("Hello"); </script>
Translate
KMarchewaAuthor
Level 3
Aug 4, 2022 12:00 PM UTC

That is correct. Even such simple statement does not work using the "Custom Code" option with the "Add to Head" option checked (I also tried <div><script>console.log("...")</script></div> WITHOUT the "Add to Head" option checked).

Translate
Amelia_Waliany
Adobe Employee
Amelia_WalianyAdobe EmployeeAccepted solution
Adobe Employee
Feb 13, 2023 9:21 PM UTC

[8.31.22 Adobe Target Community Q&A Coffee Break Answer provided by @moses_maxen: 

----------------------------

Hi @KMarchewa - thank you for your question.  We recommend opening a support ticket for this in case you are still facing trouble with delivering custom code through a particular view.  Thank you!

----------------------------

Check out the entire 8.31.22 Adobe Target Community Q&A Coffee Break discussion thread for more insights on related topics 🙂 

 

Translate