Pugpig Bolt Piano Integration
Table of Contents
Piano is a leading audience solutions provider used by publishers across the globe. We've worked closely with Piano to build a robust integration with Pugpig Bolt, giving you the ability to create powerful, seamless experiences for your users. This integration includes:
- Log in: Native and web-based PKCE
- Registration: Web-based PKCE only
- Receipt-linking: Create Piano profiles for users who subscribe via in-app purchase
- Running experiences on your timeline (using Piano Cards) or articles using our Piano Composer Integration
- Analytics: Tie user behaviour to their Piano profile
- Segmentation and messaging: Pass Piano IDs to other services, such as push
There are also some features that aren't currently supported but are either on our roadmap for future support or under consideration for such. These are:
- Content metering integrated with the Piano meters (you can of course use the Pugpig meter)
- Piano Content recommendations
White Labelled Piano Authentication Domains
We strongly recommend you set up a Piano White Labelling Domain for both production and sandbox Piano accounts - something like auth.acme.com and auth-sandbox.acmce.com
This is important to:
- ensure your app (and your website!) play nicely with Password Managers
- prevents your users seeing domains like piano.io on the login popup form
Piano Docs here: https://docs.piano.io/faq-article/domain-whitelabeling-for-piano-id/
PKCE Login
We have a full PKCE login integrated with Piano ID. This flow can allow users to log in, or create an account. We are able to start the flow on either Registration or Login, depending on the context.
You can enable Piano's Passwordless flow for the app (note you will need to use the 'Confirm with digital code' option for this in addition to/instead of 'Confirm with magic link'). Please note when testing that Piano does not send emails for sandbox.
When submitting to stores Apple require you to provide them a user with full access to allow them to review your app. When passwordless Piano has been configured this can prove problematic. To get around this you can create a Piano user (in your Piano account) that has a password in the following way:
Navigate to Edit business → User provider and edit your Piano ID configuration.
- Disable Passwordless general registration by clicking on the toggle switch.
- Register a new user with a password.
- After the user is created, re-enable Passwordless general registration by clicking on the toggle switch again.
Known PKCE Issues
- There is a known issue with Piano log out. See log-out considerations for information.
- Piano has a known bug with Twitter social sign in. They are working to resolve it.
- We have identified a bug with the social sign in flow UX on Android and we are working with Piano to resolve it.
- Android users with Firefox set as their default browser may see a blank screen/‘about:blank’ error message after clicking to sign in. Current workaround is to set the device browser to a different provider - Chrome is a good example which we know works. Piano are investigating solutions.
Information on how to configure social sign in (aka "social log in") can be found in Piano's documentation portal.
Apple: https://docs.piano.io/sign-in-with-apple/
Facebook: https://docs.piano.io/how-to-setup-facebook-social-login/
Google: https://docs.piano.io/how-to-set-up-google-social-login/
LinkedIn: https://docs.piano.io/how-to-set-up-linkedin-social-login/
Note: Sign In With Apple uses the same redirect_uri as the URL on which the flow is invoked. This could be one of your whitelabelled auth domain (e.g. auth.acme.com) which is preferred, or id.tinypass.com or id.piano.io. We need to make sure we invoke the PKCE flow using the same domain you have configured.
Login into your website by token
You might want to add the ability for a logged in user to navigate from the app to your website without needing to login again. We'll pass the Piano token in a query param when sending the user from the app to your website. For your part, you'll need to add the JS snippet below to your site:
if (!tp.pianoId.isUserValid() && fetchTokenFromQuery()) {
tp.pianoId.loginByToken(fetchTokenFromQuery());
}
function fetchTokenFromQuery() {
let paramsString = window.location.search
let searchParams = new URLSearchParams(paramsString)
let token = searchParams.get("token")
return token
}
Kindly follow this document for the setup in Distribution: https://docs.pugpig.com/sending-a-user-token-in-a-query-string
Customising your Piano Templates for the app
We also pass in a parameter that you can use in your templates so that your app can show slightly different forms to your web site. Examples where this has been used include:
- Hiding the social sign in buttons on the app screens
- Customising the Login template to have a much more friendly user interface when it is used as the first screen in the PKCE flow
User Entitlements
We base the access a user has from Piano resources, this allows you to control the access level of the user directly from Piano, and change these entitlements on the fly.
Conditional Piano Inline MPU Ad Logic
With piano subscriptions, you now have the ability to activate or deactivate inline embedded MPU advertisements within articles. This feature allows for a tailored advertising experience depending on the user's subscription status.
External Term Entitlements (Receipt Linking)
We have an out of the box integration to provide External Term entitlements if users purchase an In App Purchase for both iTunes and Google Play. See https://docs.piano.io/external-service-term/ for more information on the Piano side, and this article for more of an understanding on cross-platform entitlement
User Analytics
We are able to send any Piano user custom fields as dimensions to your analytics. We can also send the Piano User ID to push providers and other third parties. This enables segmentation in those other services based off information in your users profiles.
Piano JavaScript API
We are using the Piano JavaScript API to control parameters we send to experiences. Using the native SDK does not work as well as the JS API in the webviews where we want to show experiences.
Read more about Piano.
Pugpig Site
This article covers Pugpig Bolt - your app. If you build your website on Pugpig Site, we can support all Piano features. We also provide an infrastructure to handle Piano webhooks if needed.