Getting Started

1. Get one or more Pyze App Keys

See instructions to get one or more Pyze App Keys depending on platforms (iOS and/or Android) you support for your OutSystems app.

2. Setup & Initialize

Setup & Initialize Pyze in your OutSystems app

Build and Go!

You have enabled all screen flow funnels, loyalty, cohort and churn analysis, Intelligence data explorations, built-in events, auto segmentation, and much more. Use your app with the Pyze SDK and you should see data on growth.pyze.com.

In the following sections, you can add app-defined-, timed- and curated- events. To reach out to your users and create meaningful relationships, add push and in-app notifications.

3. Add events

Add Events to your OutSystems app.

A comprehensive overview of curated, app defined, timed and built-in events is available.

4. Build meaningful relationships with your users

Pyze delivers intelligence-driven marketing and growth automation, so you can build meaningful relationships with your users.

App SDK API, Samples, Resources for Apache Cordova developers

Setup & Initialize

Get Pyze App Keys

Get a Pyze App Key (PAK) for iOS and Android Apache Cordova apps from growth.pyze.com

1. Login to growth.pyze.com

Every app is uniquely assigned a Pyze App Key (PAK), a 22 character app specific key, which you obtain from growth.pyze.com after logging in with your email and password. If you have not signed up for Pyze, you can Get Pyze here first.

Login to growth.pyze.com

2. Add a new app

  • To add an application to the Pyze platform, begin by selecting Settings from the Navigation Pane.
  • Under the Apps Tab, click the Add App+ button at the top right of the window.
  • Enter the App Name and Appstore URL (if available), Platform (iOS, Android, Web/SaaS, tvOS, watchOS) and select your Timezone.

3. Copy Your Pyze App Key

Once you add your new app, refresh the page. Navigate to your newly added app’s settings by selecting the app from the drop-down list. The Pyze App Key will be displayed below to the right (DmPTFdslRjObk1-ZlXQDVQ in this example). Copy Pyze App Key.

Pyze OutSystems SDK: Setup & Initialize

The instructions on this page assume you have installed the Pyze SDK into your OutSystems project. If not, Install the SDK and come back to this page. See Getting Started OutSystems Guide.

Android And iOS

Running the install command will also initialize your application

  1. Open the module Extensibility Configurations
  2. Add the pyze plugin, json node to install and initialize
    {
     "plugin":{
         "identifier":"pyze-cordova",
         "variables":[{
             "name":"ANDROID_PAK",
             "value":"YOUR_ANDROID_PYZE_APP_KEY"
         },{
             "name":"IOS_PAK",
             "value":"YOUR_IOS_PYZE_APP_KEY"
         }]
     }
    }
    

    Build and Go!

Events

Pyze OutSystems SDK - Events

Custom Event Handling

To enable event tracking, add javascript component to any action, and call appropriate pyze methods:

  1. Post custom events

     pyze.cordova.PyzeEvents.postCustomEvent("DELETED TODO");
    
  2. Post custom event with attributes

     var customAttribute = {};
     customAttribute.color = "Red";
     pyze.cordova.PyzeEvents.postCustomEventWithAttributes("Event Name",customAttribute);
    

Timed Events Tracking

  1. Timed Events

         pyze.cordova.PyzeEvents.postTimedEventWithName(eventName: String, timerReference: Number, timerReferece: any)
    
  2. Timed Events with Attribute Tracking

         pyze.cordova.PyzeEvents.postTimedEventWithNameAndAttributes(eventName: String, timerReference: Number, customAttributes: Object, timerReferece: any)
    

For more information on events tracking, please refer to our Cordova API Reference

Scene Activity Tracking

To track Scene details, use the SceneFlow events to track scene transitions

        pyze.cordova.PyzeSceneFlow.postSecondsOnScene("Login",durationOnTheScene);

Enable Mobile Marketing

Push Notifications with FCM for Android

Google Notifications

Google provides the Firebase Cloud Messaging service (FCM) to allow app publishers to reach out to their users via push notifications.

App Publishers have the option of hosting and running servers “app servers” themselves to send notification content “payload” to FCM. Google then forwards the notification content to your app on user’s device.

Pyze customers do not have to maintain their own servers to communicate with Google’s Messaging service. Pyze can be used to send push notifications for an app in development, an app that is live in Google Play, and to a combination of apps in development and production.

Prerequisites

You must Create Firebase project in Firebase console. Click here after logging into the google account that owns your project for next steps.

Following sections

In the following sections, we will generate the google-services.json and enter the Server Key in growth.pyze.com. Then we will also enable push notifications in your Android project.

Configuring the Server API Key and Sender ID

In this section we will

  1. Get the Server Key and Sender ID for your app
  2. Enter the Server Key on growth.pyze.com
Generate the Server API Key and Sender ID
Login into the Google Account that owns your app
Go to Google Cloud Messaging and select Get a Configuration File
  • Obtain the Server API Key and Sender ID from the project settings for your
Enter the Server Key and Sender ID on growth.pyze.com
Login into your Firebase Console
  1. Select Your Project and Click on the Settings icon next to the Project name.
  2. In the Cloud Messagin Tab, locate the Server Key and Sender ID.
Login into your Pyze Account
  1. On the Settings page, select an app from the drop down menu.
  2. On the App Settings page, navigate to the Push Notifications settings from the left pane.
  3. Enter the Server key and Sender ID along with quota limits for the maximum number of push messages your app can send in a day and a week.
Integrate FCM Push Notifications In Your App Project
  1. Select “Data” tab of the module.
  2. Select resources and import the “google-services.json”.
  3. Select the imported “google-services.json” file and update the “Deploy Action” to “Deploy to Target Directory”.
  4. Enter “Target Directory” as “google-services”.

Push Notifications with APNS for iOS

Apple Push Notifications

Apple provides a Apple Push Notification service (APNs) to allow app developers to reach out to their users via push notifications.

The App businesses have the option of hosting and running servers “provider” themselves to send notification content “payload” to Apple over a persistent and secure channel using HTTP/2 multiplex protocol. Apple then forwards the notification content to your app on user’s device.

Pyze customers don’t have to maintain provider servers to communicate with Apple’s push notification service. Pyze can be used to send push notifications for an app in development, an app in production provisioned through the app store, and to a combination of apps in development and production.

Prerequisites

You will need access to your Apple developer Account, Xcode development environment, macOS Keychain Access, and finally iTunes Connect to publish your push-notification enabled app.

Using Pyze as your provider for push notifications

We enable push notifications inside app by default. User doesn’t have to make any code changes.

You need to create APNs SSL certificates, use your Keychain to convert it into a file (.p12) and upload it to growth.pyze.com.

In-App Notifications

Enable In-App Notifications In Your App

In-app notifications allow app publishers to reach out to app users when they use your app. In-App Notifications are deeply integrated in Pyze Growth Intelligence and allow app publishers to reach out to users from manually from Dynamic Funnels and Intelligence Explorer, and automatically based on workflows and campaigns from Growth Automation.

Invoke In-App Notifications
pyze.cordova.Pyze.showInAppNotificatonWithCustomAttributes("PyzeInAppTypeAll", "#c9c9c9", function(messageDetails){
   pyze.cordova.PyzeEvents.postCustomEvent("OS CTA Clicked");
   pyze.cordova.Pyze.closeInAppMessage();
 });

Sending In-App Notifications From growth.pyze.com

In-app notifications allow app publishers to reach out to app users when they use your app. In-App Notifications are deeply integrated in growth.pyze.com and allow app publishers to reach out to users from manually from Conversion Funnels and Auto Segmentation, and automatically based on workflows and campaigns from Growth Automation. For illustration purposes, we will send In-App Notifications from Conversion Funnels.

  • Sending In-App notifications from Conversion Funnels

    Create an event sequence and specify filters. You can reach out from either Build & Run or from Saved Funnels.

    Create and send an In-App Notification. In this example, we will congratulate the user for reaching a milestone with a reward.

Enable Personalization

Personalization Intelligence™

Enable Personalization in your App

To learn more about personalization see here.

In Intelligence explorer, for example, you may assign “High Value” tag to users who match the following criteria. This tag will be available in your app to personalize content feed, experience, user interface or messaging.

  • High Engagement and High Loyalty or
  • High Advocacy and Seasonal Ticket Holder or
  • High Revenue or
  • High Engagement, High Advocacy, and Low or Medium Attrition Risk or

The Personalization Intelligence™ tags assigned to a user are available in the agent and are accessible via class PyzePersonalizationIntelligence

The following methods are available in this class

getTags(callback)

Get all tags assigned to the user.
Note: Tags are case sensitive, High Value and high value are different tags.

Usage

pyze.cordova.PyzePersonalizationIntelligence.getTags(function(tags){
    console.log(tags);
});
isTagSet(tag, callback)

Returns true if requested tag is assigned to user.
Note: Tags are case sensitive, High Value and high value are different tags

Usage

pyze.cordova.PyzePersonalizationIntelligence.isTagSet("loyal", function(tagExists) {
    console.log(tagExists);
});
areAnyTagSet(listOfTags, callback)

Returns true if at least one tag is assigned.
Note: Tags are case sensitive, High Value and high value are different tags.

Usage

pyze.cordova.PyzePersonalizationIntelligence.areAnyTagSet(["loyal","High Value","Low value"], function(tagExists) {
    console.log(tagExists);
});
areAllTagSet(listOfTags)

Returns true if all tags requested are assigned to user.
Note: Tags are case sensitive, High Value and high value are different tags.

Usage

pyze.cordova.PyzePersonalizationIntelligence.areAllTagSet("loyal,High Value,Low value", function(tagExists) {
    console.log(tagExists);
});

User Privacy

Pyze provides APIs to allow end-users to Opt out of Data Collection and also instruct the Pyze system to forget a user’s data.

setUserOptOut

Allows end-users to opt out from data collection. Opt-out can be toggled true or false.

pyze.cordova.Pyze.setUserOptOut(true) 

To resume user data collection set value to false

pyze.cordova.Pyze.setUserOptOut(false) 

deleteUser

Allows end-users to opt out from data collection and delete the user in the Pyze system. We recommend you confirm this action as once a user is deleted, this cannot be undone.

pyze.cordova.Pyze.deleteUser(true)