0

I have a cloud page where I have an SSJS script that triggers the API call. When I preview this page using cloudpage preview, I get an error saying the are errors in the cloud page, although this script runs successfully from script activity in automation studio. But when I publish this page and view the page using the URL, the API call runs successfully. So my question is :

  1. By just previewing the cloud page from the cloud-page preview, does this trigger the API call in general or not? In order to run the call the cloudage URL needs to be opened?

1 Answer 1

1

It won't.

During Publishing, when CloudPages tries to render saved content, sometimes the preview doesn’t render to prevent executing inadvertent actions.

To be clear:

These actions can include but aren’t limited to:

Incomplete or incorrect MC scripting (AMPscript, SSJS, or GTL)
MC scripting calls that modify data
MC scripting calls that require a sendable context

Reference: Preview Content in CloudPages

So you need to publish the page to test functionality.

2
  • does that mean if I have made changes to the the published page and then preview it in cloudpage preview will it execute the API call or it does not execute the APIcall at all in cloudpage previews? Feb 15, 2023 at 13:18
  • @sfmcuser82919 it won't if the MC scripting calls that require a sendable context/modify data in MC and it will if your API call doesn't relate to those actions. In your case, you mentioned that it ran successfully in automation studio so it supposes to be the first case
    – Duc Le
    Feb 15, 2023 at 13:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .