PRODUCT

Amazon Ad Server will be sunset in Q4 2024, please visit this page (AAS offboarding information) for offboarding support resources and sunset FAQs. Details shared on that page represent the most up to date information in the Help Center, if you find disparate information in other resources please default to the information in the AAS offboarding information page accordingly.

Please note that on October 1, 2024, the ability to create new campaigns, placements and tag managers was disabled.

Follow
  • Creative > Ads > New Ad > Ad Builder

Ad Builder provides you with a wide range of pre-configured actions and animations to meet most requirements.

If you still need to add JavaScript code to your ad, use the dedicated JavaScript editor accessible from the Run JavaScript action.

Procedure
  1. In the Properties pane, open the Actions and Animations pane.

  2. Create an event for the component to which you want to add JavaScript code. This example shows adding a Tap/Click event to a hotspot.

  3. Under Add Action > New Action > Select Action, select Custom Actions > Run JavaScript.

    action-run_js.png
  4. Click Open Code Editor.

    js_editor.png
  5. Define your JavaScript code, and then click Apply. You do not need to add the <script> tag; simply enter your JavaScript code. This example shows adding a confirm dialog box.

  6. Click Preview, and verify that your code is running correctly on the ad.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments