Landing Pages

Landing Page Endpoint Reference

Landing Pages are web pages hosted by Marketo.

Query

Like most other assets, Landing Pages can be queried by name, by id, and by browsing.  These queries will only return metadata, and the list of content sections for a landing page must be queried separately by the id of the landing page.

Querying the content of the landing page will return a list of content sections available in the landing page.  A section must be present in the content list of a page in order to update the content:

Results will differ between guided and free form templates, as guided landing pages come with a set of sections which are defined by the template from which they are derived, while free form pages do not come with predefined sections, and their content must be added prior to editing.  Note that the format of the “content” attribute can vary depending on the “type” attribute, and wether the field is static or dynamic.

Create and Update

Landing pages are created by referencing back to a template.  The only required fields for creation are name, template (the id of the template), and the folder to place the page in.  For additional metadata that can be populated, see the endpoint reference.

Valid content types for landing page content endpoints are: richText, HTML, Form, Image, Rectangle, Snippet.

Landing page metadata can be updated with the Update Landing Page Metadata endpoint.

Approval

Landing Pages follow the standard draft-approved model, where there can be a draft version and/or an approved version.  Whenever updates are applied to a page, they are always applied to the draft version first, and will only be seen live when the page has been approved.

Delete

To delete a landing page it must first be out of use and not reference by any other Marketo assets, as well as unapproved.  Pages are deleted individually with the Delete Landing Page endpoint.  Landing pages with embedded social buttons cannot be deleted through this API. 

Manage Content Section

Content sections are ordered by their index property, and ultimately laid out according to whatever CSS rules are applied when displayed by the client.  Content sections are included and managed with the corresponding Add, Update and Delete Landing Page content section endpoints, and can be queried using Get Landing Page Content.  Each section has a type and a value parameter.  The type determines what should be put into the value.  For these endpoints, data is passed as POST x-www-form-urlencoded, not as JSON.

Section Types

Type Value
DynamicContent The id of the segmentation.
Form The id of the form.
HTML Text HTML content.
Image The id of the image asset.
Rectangle Empty.
RichText Text HTML content.  May only contain rich text elements.
Snippet The id of the snippet.
SocialButton The id of  the social button.
Video The id of the video.

For free form pages, all desired content sections must be added and will be embedded in the div element with the id mktoContent.  For guided pages, a list of predefined elements may be present in the list from Get Landing Page Content endpoint.  More can be added or their content updated via their respective endpoints.

Dynamic Content

To make a Dynamic Content section, it must already be present in the landing page’s content list.  The Update Landing Page Content Section endpoint then needs to be used to set the type to ‘DynamicContent’.  When a section is set to dynamic content, it creates underlying dynamic sections within the content section which all inherit the base type of the converted element.  Each dynamic section also inherits the content from the converted section.

Updating the content for each individual segment is done on the basis of the segment id.

Variables

One of the features introduced in guided landing pages is editable variables.  Variables contain values for elements on a landing page.  Variables can easily be modified using the landing page editor as shown below:

doc-rest-api-landing-page-variables

Variables are defined as meta tags inside <head> element of a guided mode landing page template. There are three types of variables available: String, Color and Boolean.  Here is an example of three variable definitions:

For more information see “Editable Variable” section in Create a Guided Landing Page Template documentation.

Query

Retrieve variables for a guided landing page by passing the landing page id to Get Landing Page Variables endpoint.

In  this example, the guided landing page contains 3 variables: stringVar, colorVar, boolVar.

Update

Update a variable for a guided landing page by passing the landing page id, the variable id, and the variable value to Update Landing Page Variables endpoint.