We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

The Params Object

Overview

The params object contains variables about the environment where a Piano offer template is triggered. Every time a user views an offer template the params object captures data about the user, the template the user is viewing, the experience that triggered the template, and any term the user selects from within the template. This information can be leveraged both within Piano's offer templates and during communication between third-party systems and Piano.

The params object contains the following parameters:

Parameter

Description

aid

Application ID

. Can be found in the Dashboard of your Piano account.

url

The URL of the page the user was on when the offer template first displayed. If you're redirecting a user to another page for registration and checkout, the URL parameter allows you to automatically send users back to the content they were viewing before the checkout process began.

trackingId

Tracking ID associates users in Piano's system with actions those users take in third-party applications. It allows Piano to calculate conversion rates for users who view one of Piano's offer templates and then convert on a term in an outside system. See

here

for more information on working with trackingId and

here

for details on how to track third-party conversions.

iframeId

 The ID of the template's iframe element. This parameter is important when communicating information back to a Piano template after collecting form data. To see it in action, check out

this guide

on collecting email addresses.

termId

The ID of the term the user has selected. This is important during integrations with third-party registration systems. TermId allows for the users to select terms in Piano offer templates, login/register through third party user management systems, and then have the correct term information populated when the checkout process is handed back to Piano. 

See here

for more information on how this works.

debug

Based on whether you've set Piano's debug mode to true or false.

displayMode

The display mode of the template. Accepted values are inline or modal. Could be used to show or hide certain elements when the template is inline or modal.

experienceId

The ID of the Composer experience that triggered the offer template.

OfferId

The ID of the offer connected to the displayed offer template.

tags

Provides you with access to any page tags you've set in Piano's JavaScript library.

templateId

The ID of the template that was displayed.

templateVariantId

The ID of the variant that was displayed.

width

The width of the offer template in pixels.

Accessing Params Within Piano Templates

Any of these parameters can be accessed by calling them from params object within the template. The parameters are parsed like this: params.parameter. A few examples of params in use:

<a href="https://yoursite.com/login?redirect={{params.url}}" target="_parent">Login</a>
<div ng-if="params.debug">
  This is raw data about the page tags in debug mode:
  {{params.tags}}
</div>
<div ng-show="params.displayMode=='inline'">This element will only be rendered for inline template</div>

Accessing Params within Third-Party Systems

The params object and its associated parameters are often used for communication to and from third-party systems. TrackingId is used to track conversion events outside the scope of Piano. IframeID allows you to send data back to a Piano template after a user completes some action. And the entire params object is used to restart checkout within Piano after a user successfully registers in a third-party user management system.

Last updated: