1

I can't figure out how to get GTL working on CloudPages. I was informed that it should work.

Here's my HTML:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
      <title>GTL Test
      </title>
      </head>
    <body>
      %%[
      var @reservationData
      set @reservationData = '{"reservationId":"RXJ34P","passengerPriorityStatus":"Fast Track","passengerSequenceNumber":"ABC123","securityScreening":"TSA PreCheck"}'
      ]%%
      {{.datasource reservation type=variable}}
      {{.data}}
      { "target" : "@reservationData" }
      {{/data}}
      <p>Your reservation code is: {{reservationId}}
      </p>
      {{/datasource}}
    </body>
    </html>

Nothing special here. If I view the published page, I see the raw GTL datasource block:

rendered page

However, if I copy and paste the same HTML into an email, then preview the email, it displays correctly.

Does anyone know how to get GTL working in Cloud Pages?

5

It turns out that GTL is supported in CloudPages and Landing Pages after all. However, you need to reset the GTL delimiters by placing the following line at the top of your content: %%{={{ }}=}%%

So the page will look like this:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
      <title>GTL Test
      </title>
      </head>
    <body>
      %%[
      var @reservationData
      set @reservationData = '{"reservationId":"RXJ34P","passengerPriorityStatus":"Fast Track","passengerSequenceNumber":"ABC123","securityScreening":"TSA PreCheck"}'
      ]%%

      %%{={{ }}=}%%

      {{.datasource reservation type=variable}}
      {{.data}}
      { "target" : "@reservationData" }
      {{/data}}
      <p>Your reservation code is: {{reservationId}}
      </p>
      {{/datasource}}
    </body>
    </html>
|improve this answer|||||
1

It looks like your AMPScript code is not getting executed properly. I presume you've already published this. You may want to double check a few things.

1) Page is properly published using the steps mentioned here

2) Check whether the published status is 'Live' or 'Offline'

3) If the above still don't work, I'd recommend you simplify the AMPScript code to dump the values to see if that gets reflected on the Cloud Hub pages. Then incrementally add code back to your page until you're able to isolate the problem.

|improve this answer|||||
  • There's nothing wrong with my AMPscript block; I'm only using AMPscript to define my target datasource. I can use AMPscript to print variables on the page without issue as indicated in this gist however, it's displayed on the page as Your reservation code is: {{reservationId}}. Again, this works fine if I use the same content in an email. It appears that GTL is simply not supported in CloudPages. – Eliot Harper Jun 28 '16 at 18:34
0

I've received an official response from Salesforce (actually, directly from the GTL engineering team) who advised that CloudPages and Landing Pages don't support GTL at this time.

|improve this answer|||||

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.