Add link to an Offer

  • There are four ways to add links to an offer, including using OfferClass.LinksModuleData, OfferObject.LinksModuleData, OfferObject.appLinkData, and OfferClass.appLinkData.

  • App linking enhances call-to-action by directing users to branded experiences from Google Wallet, with links displayed at the bottom of the Pass.

  • You can set the OfferObject.appLinkData field to the URI or Package name to enable app linking for a specific offer.

  • The appLinkData field allows you to specify androidAppLinkInfo and webAppLinkInfo for deep linking into your app or website, with a customizable displayText limited to 30 characters.

  • While linking to the Play Store is possible using targetUri within androidAppLinkInfo, it's recommended to utilize packageName for a direct in-app experience.

There are four ways to add links to a offer.

  • Use OfferClass.LinksModuleData to add links to all offers that are associated with the OfferClass.
  • Use OfferObject.LinksModuleData to add a link to a specific offer OfferObject.
  • Use OfferObject.appLinkData to place an app link at the bottom of that particular Pass.
  • Use OfferClass.appLinkData to place an app link at the bottom of all the passes of that class.

One benefit of app linking is that it empowers your call-to-action to navigate users to your branded experiences from Google Wallet. Links with this feature appear at the bottom of the Pass.

Feature example

Issuer Name Applink Data Example
Issuer

For a given offer, set the field OfferObject.appLinkData to the URI or Package name of your app or website.

See the format and context of the appLinkData field in the following source code: The displayText field is limited to 30 characters.

  {
    "id": string,
    "classId": string,
    …
    …
    …
    "appLinkData": {
      "androidAppLinkInfo": {
        "appTarget": {
          "packageName": "com.google.android.gm",
        }
      },
      "webAppLinkInfo": {
        "appTarget": {
           "targetUri": {
              "uri": "https://mail.google.com/mail/",
              "description": "Web link for Gmail"
           }
        }
      }
      "displayText": {
        "defaultValue": {
           "value": "Our awesome app!"
        }
      }
    }
  }
For posterity the following implementation will also work.
{
  "id": string,
  "classId": string,
  …
  …
  …
  "appLinkData": {
    "androidAppLinkInfo": {
      "appTarget": {
        "targetUri": {
          "uri": "https://play.google.com/store/apps/details?id=com.google.android.gm",
            "description": "Play store link for Gmail app"
        }
      }
    }
  }
}