What is an AMPscript?

What is an AMPscript?

AMPscript is Marketing Cloud’s proprietary scripting language for advanced dynamic content in emails, landing pages, SMS, and push messages. While AMPscript uses basic programming concepts, you don’t have to be a coder to understand AMPscript functions and to use it in your emails.

Does JavaScript work on amp?

amp-script lets you write and run your own JavaScript in a way that maintains AMP’s performance guarantees. Most AMP components enable common web interactions through their own logic, letting you build your page quickly without writing JavaScript or importing third-party libraries.

How to use AMP-script to add custom JavaScript?

Good news for you AMP-based website developer. AMP Project as an AMP HTML developer recently announced the latest AMP component which was announced directly via Twitter @amphtml. AMP Project announces that the component will soon be usable and currently can be used in experimental mode.

Where does the JavaScript run in amp.dev?

To maintain AMP’s performance guarantees, your code runs in a Web Worker, and certain restrictions apply. Your JavaScript can access the area of the page wrapped within the component. amp-script copies the component’s children to a virtual DOM.

How to use AMP script with multiple script hashes?

If your page contains multiple amp-script elements, each requiring a script hash, include each as a whitespace-delimited list in a single tag (see examples/amp-script/example.amp.html for an example with multiple script hashes). How does it work? amp-script runs your custom JavaScript in a Web Worker.

How does AMP-script work in a web worker?

amp-script runs your custom JavaScript in a Web Worker. Normally Web Workers don’t have access to the DOM. But amp-script gives your code access to a virtual DOM. When your JavaScript modifies this virtual DOM, amp-script updates the real DOM.

https://www.youtube.com/watch?v=kLgnRleeP3s