Skip to content

Getting Started with StreetHawk Growth

Introduction

StreetHawk Growth is a solution which:

  • Lets you track viral user acquisition as a result of referral activity by your existing App users or from short links (deeplinks) you create in the StreetHawk Dashboard.
  • Lets you measure and analyze your App Virality which can be viewed in StreetHawk's dashboard.
  • Lets your potential App user(link receiver) to see the deeplinked page configured by the link sender.
  • Lets you obtain realtime clicks/installs count so that you could complete your reward systems.

How It Works

(click here for more detail)

To describe a very simple use case, lets assume a recipe app and the user would like to share an amazing recipe with her friends. Here is a user view of the process:

Prerequisite

  • app_key
    We assume that you have registered your application with StreetHawk and has an app_key associated with it. In case you don't have app_key, please register your application and reserve your app_key here.

  • StreetHawk SDK
    We also assume that your application is integrated with StreetHawk SDK. If not, please click here and refer to integration steps for your application's development platform.

Integrating Steps for iOS Application

Step 1: Register URL types in App

StreetHawk Growth requires deep linking scheme registered in the Application so that a share link will bring users to the correct deep linked page.

Step 2: User A shares a short link to her friends. It calls originateShareWithCampaign in button clicking event.

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 get the generated url and share by any way ie (email, post on Facebook etc). A scheme for deep linking is required for StreetHawk growth.

  • Generate share link and handle in application

  • In this case, SDK fetches the share link and pass it to application to present it to user for sharing it. Below is the sample code.

NSString *ID = @"ShareViaFacebook"
NSString *shareLink = @"recipeApp://homepage?recipe=chocolatechipcookie";
NSString *utm_source = @"Facebook";
NSString *utm_medium = @"cpc";
NSString *utm_term = @"facebookAdd";
NSString *campaign_content = @"best chocolate chip cookie recipe";
NSString *default_url = @"http://recipeApp.com/chocolatechipcookie";
[StreetHawk originateShareWithCampaign:ID withSource:utm_source withMedium:utm_medium  
withContent:campaign_content withTerm:utm_term 
shareUrl:[NSURL URLWithString:shareLink] 
withDestinationUrl:[NSURL URLWithString:default_url] 
streetHawkGrowth_object:^(NSObject *result, NSError *error)
    {
        presentErrorAlert(error, YES);
        if (error == nil)
        {
            dispatch_async(dispatch_get_main_queue(), ^
            {
                NSString *shareUrl = (NSString *)result;
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"share_guid_url" message:shareUrl delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
                [alert show];
            });
        }
    }];
  • Generate link with source selection

  • In this case the SDK presents user with list of applications (Email, SMS, Facebook, Twitter, Sina Weibo, Tencent Weibo) on which the URL can be shared and picks utm_source parameter as per the user's selection. Below is the sample code.

NSString *ID = @"ShareViaFacebook"
NSString *shareLink = @"recipeApp://homepage?recipe=chocolatechipcookie";
NSString *utm_medium = @"cpc";
NSString *utm_term = @"facebookAdd";
NSString *campaign_content = @"best chocolate chip cookie recipe";
NSString *default_url = @"http://recipeApp.com/chocolatechipcookie";
[StreetHawk originateShareWithCampaign:ID withMedium:utm_medium 
withContent:campaign_content withTerm:utm_term 
shareUrl:[NSURL URLWithString:shareLink]
 withDestinationUrl:[NSURL URLWithString:default_url] 
withMessage:@"This is the best chocolate!"];
Parameter Data type Description
utm_campaign NSString Optional, for identify how this share is used for. For example in a book App, it would be "Child", "Computer", "Poetry".
utm_source NSString Optional, indicate where share url will be posted (Example facebook, twitter, whatsapp etc). It's free text string.
utm_medium NSString Optional, medium as url will be posted. For example cpc.
utm_content NSString Optional, content of campaign.
utm_term NSString Optional, keywords for campaign.
shareUrl NSURL Optional, deeplinking url which will open App by browser link. For example, to open App page with parameter, url like "SCHEME://HOST?param1=VALUE1&param2=VALUE2".
default_url NSURL Optional, fallback url if user opens url not on iOS or Android mobile devices. It's a normal url to display on browser, for example the developer's website which describes the App, like http://www.myapp.com.
handler SHCallbackHandler Share result callback handler, when successfully share `result` is share_guid_url, otherwise it contains error.

Step 3: User B clicks the short link and App handles this deeplinking url. For how to handle deeplinking url please check here.

Integrating Steps for Android Application

Step 1: Register Scheme and URI for deeplinking

StreetHawk Growth requires deep link parameters such as Scheme and URI registered in your application AndroidManifest.xml file as shown below

<manifest>
....
....
<application>
....
....
<activity
    android:name="com.example.shsample.SetParams"
    android:label="@string/title_activity_set_params">
    <intent-filter android:label="SetParams">
        <action android:name = "android.intent.action.VIEW" />
        <category android:name = "android.intent.category.BROWSABLE"/>
        <category android:name = "android.intent.category.DEFAULT"/>
        <data android:scheme="<SCHEME>"/>
    </intent-filter>
</activity>
....
....
</application>
....
....
</manifest>

Step 2: Call getShareUrlForAppDownload() in onClickListener of share button.

getShareUrlForAppDownload returns a universal share url which your application users can share with others irrespective of operating systems running on their phones. Below is a sample code snippet for obtaining and sharing the url.

 shareButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String ID = "ShareViaEmail"
                String shareLink = "recipeApp://homepage?recipe=chocolatechipcookie";
// For you application running on android only, this can be deeplink url
                String subject = "I have a great recipe to share with you!";
                String body = "I love this App, its got lots of yummy recipes";
                                  StreetHawk.getShareUrlForAppDownload(getApplicationContext(), ID, shareLink, new IStreetHawkGrowth() {
                        @Override
                        public void onReceiveShareUrl(String shareUrl) {

// Intent to launch application to share url

Intent intent = new Intent(Intent.ACTION_SEND);
                        intent.setClassName(packageName, className);
                        intent.setType("text/plain");
                        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        intent.putExtra(Intent.EXTRA_TEXT, shareUrl;
                        mContext.startActivity(intent);
                        }

                        @Override
                        public void onReceiveErrorForShareUrl(JSONObject errorResponse) {
                            Log.e(TAG,"Error while obtaining share url");
                        }
                    });
               }
        });
}

Setup fallback URLs

The above configurations can empower your App with deep linking features. With the help of next few steps, the short links will bring your users to the place you want.

  • In StreetHawk console, please navigate to App Details > App Summary page and provide your AppStore ID and Google Play ID if you have. By providing them, StreetHawk will know your App download page and bring your users to the correct place depending on their platforms.

  • If you haven't finished Organic Growth on-boarding step, please navigate to Installation > (select your development platform) > Organic Growth and setup your global fallback URL here. This can be the URL of your default landing page that you can't wait to show to your customers.

Using a Webhook for Install & Sharing Events & tagging

You may want to connect StreetHawk to your own system to get realtime notification of these event. You can do this by specifying a webhook url in StreetHawk console.

Please navigate to App Details > App Summary page and enter your callback endpoint in the field named webhook URL. Currently, it will be called under three events:

  • every time a short link is clicked (event = 'click')
  • every time a successful install is achieved by a short link (event = 'install')
  • every time sh_cuid (customer unique id) is tagged (event = 'cuid')

The following parameters will be submitted to your webhook URL automatically by a POST method, so please be ready to accept them. The endpoint has to accommodate to the following format:

WARNING: The parameter will be POST to the webhook url as raw JSON. Please be ready to handle it.

Name: a valid URL starting with http or https
Method: POST
Response Time: within 5 seconds (otherwise, it'll be disconnected)
Return: (No limitation, so as you want)
Parameters:

Name Type Description Example
share_url string the URL for the short link http://hwk.io/s/ABCDEF
sh_cuid string the link originator's sh_cuid robert@example.com
installid string the installid for the originator AAAAAAAABBBBBBBB
installer string the installer's sh_cuid (if 'install' event) OR empty (if 'click' event) alex@example.com OR <nothing>
installer_installid string the installid for the installer CCCCCCCCDDDDDDDD
event string either 'click' or 'install' or 'cuid' (without quotation) install
app_key string the app_key behinds the share_url Facebook
scheme string the scheme that App has registered to achieve deep linking fb
uri string the uri that App can parse to display a deep linked page profile/123456
destination_url_default string the link specific fallback url https://www.facebook.com/profile/123456
share_datetime string the share_url created UTC time 2015-08-27 08:15:00.047
utm_campaign string used for keyword analysis. Use utm_campaign to identify a specific product promotion or strategic campaign. spring_sale
utm_source string use utm_source to identify a search engine, newsletter name, or other source google
utm_medium string use utm_medium to identify a medium such as email or cost-per-click. cpc
utm_content string use for A/B testing and content-targeted ads. Use utm_content to differentiate links that point to the same URL. textlink
utm_term string Use utm_term to note the keywords for this link. running+
installs int how many installs the link achieves 100
clicks int how many clicks on this link 200
not_installed_clicks int how many clicks are on a device which doesn't have the app installed 160
installed_clicks int how many clicks are on a device which does have the app installed 40
real_sources dict this field tells you the number of clicks coming from different actual sources {"facebook":400, "twitter": 100}
type string either 'viral' or 'organic' (without quotation) organic
title string a friendly name of this link My FB Link 1
isinvited boolean identify if install is achieved by invitation or not, and it's included for 'cuid' event ONLY (null will be given for all the other events). true/false/null

Now you can start creating your specific short links from StreetHawk console or via StreetHawk API call. Then you can start tacking the performance of each links via StreetHawk Dashboard. Check out here on how StreetHawk Growth work in detail and Happy Deep Linking!