Skip to content

Growth

Introduction

StreetHawk's Growth plugin lets your application user share your application ,deeplink into app pages and presents you with the analytics for your application's viral growth.You can find the source code of the plugin here.

Integration steps


  • Add streethawkanalytics plugin
    Growth plugin depends on analytics plugin.Click here to integrate StreetHawk's Analytics plugin if you haven't already done it.

  • Add streethawkgrowth plugin
    Execute below mentioned command to apply StreetHawk.

$ cd <APPLICATION_DIRECTORY>
$ cordova plugin add streethawkgrowth

Alternatively you can use plugman to install the plugins by using following commands:

plugman install --platform <android|ios>  --project ./PATH_TO_PROJECT/platform/<android|ios> --plugin streethawkgrowth
  • Modify Info.plist
    Add Open Url scheme in Info.plist.

  • Input App ID
    Input your App ID into web console locating: App Details->App Summary->Apple App ID, which is formatted as <Team ID>.<Bundle ID>.

The team id and bundle id can read in https://developer.apple.com, section "iOS App IDs":

  • Add associate domain in XCode project
    In XCode project, select the target, Capabilities->Associate Domains, add domain applinks:hwk.io

Normally XCode can automatically re-generate provisioning profile for this change. In case XCode fail to do it, please go to https://developer.apple.com to enable "Associate Domains" in App ID, and re-generate provisioning profiles.

Implement Growth functions

  • Generate share link
    StreetHawk Growth feature lets your user share your application with friends. Also the feature can be extended to invite the new user to a deeplinking page inside your application. Create a Share button inside your application and call originateShareWithCampaign to generate the share url. App can fetch this generated url and share by any medium ie (email, post on Facebook etc). A scheme for deep linking is required for StreetHawk growth.
var sh = cordova.require("com.streethawk.core.Streethawk");
function success(result) {
     var url = result;  //Universal unique url for sharing 
     alert(url);
}        
sh.originateShareWithCampaign(utm_campaign, utm_source, utm_medium, utm_content, utm_term, deeplinkUrl, default_url, success, function(){});
Parameter Type Description
utm_campaign string ID for the campaign. (Optional parameter)
utm_source string Source by which url will be shared For example email, facebook, twitter, whatsapp etc (Optional parameter)
utm_medium string Medium using which url will be shared. For example cost per click (cpc) (Optional parameter)
utm_content string Content of campaign. (Optional parameter)
utm_term string keywords for campaign. (Optional paramater)
deeplinkUrl string Deeplink URL if you wish to route your new user to a page in your application. (Optional Parameter)
default_url string Fallback url if the shared url is launched from a non supported platform such as desktop (Optional Parameter)

Alternatively to automate the process of presenting user with share source and detecting utm_source at run time , use originateShareWithSourceSelection() API as shown below.

var sh = cordova.require("com.streethawk.core.Streethawk");
sh.originateShareWithSourceSelection(utm_campaign, deeplinkUrl, default_url);
Parameter Type Description
utm_campaign string ID for the campaign. (Optional parameter)
deeplinkUrl string Deeplink URL if you wish to route your new user to a page in your application. (Optional Parameter)
default_url string Fallback url if the shared url is launched from a non supported platform such as desktop (Optional Parameter)
  • Handle shared deeplinking Url
    Use shDeeplinking function to receive the deeplink URL used for launching your application. For Phonegap, as native cannot handle the deeplink request, the application is expected to parse this URL, extract the parameters and route user to desired page
var sh = cordova.require("com.streethawk.core.Streethawk");
sh.shDeeplinking(function(result){URL=result},function(){});  // here result is calling URL