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 |
|---|---|
|
|
Application ID . Can be found in the Dashboard of your Piano account. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
Based on whether you've set Piano's debug mode to |
|
|
The display mode of the template. Accepted values are |
|
|
The ID of the Composer experience that triggered the offer template. |
|
|
The ID of the offer connected to the displayed offer template. |
|
|
Provides you with access to any page tags you've set in Piano's JavaScript library. |
|
|
The ID of the template that was displayed. |
|
|
The ID of the variant that was displayed. |
|
|
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.