3

Simple question: how do you guys develop (write) a landing page and test it? Publishing and waiting for updating url and refreshing?

Isn't that a little bit "horrible"?

Any idea of developing and testing with cloudpages?

How can I see errors in my ampscript code when my landing url throws a 500 error?

Thank you!

5

I use the HTTPGET() AMPScript function to pull in the content from an external web server when developing pages. Like this:

%%=TreatAsContent(HttpGet(Concat("http://example.com/your-page.html?x=",GUID())))=%%

Then when everything is functional, then I copy the code from the web server back into the Cloud Pages and publish it.

This method also works for email development.

  • Can I use this trick for ampscript too? Ty ! – MrViSiOn Oct 28 '16 at 7:30
  • Yes, the ampscript can be written and stored on the external web server, but will not be evaluated. The TreatAsContent function in the landing page code will evaluate the ampscript stored in the external file. – David Devoy Nov 16 '16 at 22:05
  • 1
    If the ampscript contains syntax error, the page may still return a generic 500 error. I try to avoid this by wrapping the ampscript code in the landing page with a SSJS try catch statement. (reference: salesforce.stackexchange.com/questions/141302/…) – David Devoy Nov 16 '16 at 22:11
  • Adam, best advice ever. This will save me hours and hours of waiting for MC Landingpages !! – Michael H Jul 20 '17 at 16:57
1

I use the ContentBlockbyKey() AMPScript function in the landing page, to pull in SSJS from a content block, like this:

%%=ContentBlockbyKey("ContentBlockTestSSJS")=%%

On each request of the landing page, the referenced content block resolves to whatever updates I've saved regardless of any caching. So you don't have to wait 5 minutes to test your page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.