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?

3 Answers 3

7

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>
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.

1
  • 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. Commented Jun 28, 2016 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.

You must log in to answer this question.

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