Is it possible to embed a Cloud Page as External Content in an email? I am using HTTPGet and linking correctly to the page, but it comes back as ASCII characters. Other sites work, but Cloud Pages don't. Is there a specific way to do this or is there some limitation of which I am unaware?

This is my current method:

%%=TreatAsContent(HTTPGet('CLOUD PAGE URL'))=%%

This has been an ongoing issue and appears to be due to SFMC compressing and encoding Cloud pages in the background without the user even knowing this is happening. Albeit, this is actually a pretty cool service - it can be frustrating to work around without the proper knowledge and documentation.

The best solution I have seen is from @sforce (answer copied below in case link dies), but there are some other viable solutions in that thread that may better fit your use case.

Similar answer here as well for reference

var targetSite = "https://pub.s7.exacttarget.com/f42z3hbhzzzz"
var result = HTTP.Get(targetSite,['Accept-Encoding'],['gzip, deflate, sdch, br']);

var targetSite = "https://pub.s7.exacttarget.com/f42z3hbhzzzz"
var result = HTTP.Post(targetSite,'text/html','test',['Accept-Encoding','x-request-id'],['gzip, deflate, sdch, br','cp']);
  • Thanks for the answer. This looks like it would go in the right direction for me. In what context would this be applied? In the Cloud Page or the email? I'm not sure what the application would be.
    – Kris K
    Jun 18 '18 at 20:58

Adding on to what @sforce had provided, this is what I ended up with writing the SSJS in context:

<script runat="server">

  var url = "http://PAGEID";
  var headerNames = ["Accept-Encoding"];
  var headerValues = ["gzip, deflate, sdch, br"];
  var response = HTTP.Get(url, headerNames, headerValues);


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.