Google Cloud Storage

AIRSHIP MAINTAINED INTEGRATION

This integration is maintained by Airship. Please contact Airship for support.

Google Cloud Storage is a secure, cloud-based storage service. The process below explains how to route events from Airship Real-Time Data StreamingA service that delivers engagement events in real time via the Data Streaming API or an Airship partner integration. into a Google Cloud Storage bucket.

GCS Integration Requirements

This integration requires these accounts:

  1. GCS
  2. Airship — Must include both:

Creating a GCS Bucket

  1. Log in to the Google Cloud Platform console.
  2. Create a bucket. See Create buckets in Google’s Cloud Storage documentation.
  3. Create a JSON Formatted Private Key. See Cloud Storage authentication in Google’s Cloud Storage documentation.
  4. Download the private key and open the file. You will paste the private key in the next step.

    This is an example of a JSON-formatted private key. “REDACTED” appears where sensitive information would normally appear.

    {
      "type": "service_account",
      "project_id": "REDACTED",
      "private_key_id": "REDACTED",
      "private_key": "-----BEGIN PRIVATE KEY-----\nREDACTED\n-----END PRIVATE KEY-----\n",
      "client_email": "REDACTED@REDACTED.iam.gserviceaccount.com",
      "client_id": "REDACTED",
      "auth_uri": "https://accounts.google.com/o/oauth2/auth",
      "token_uri": "https://accounts.google.com/o/oauth2/token",
      "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
      "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/REDACTED%40 REDACTED.iam.gserviceaccount.com"
    }

Configuring the GCS Integration

You will need your bucket name and JSON-formatted private key.

In Airship:

  1. Go to Settings.
  2. Under Project Configuration, select Manage for Real-Time Data Streaming.
  3. Under Real-Time Data Streaming, select Google Cloud Storage.
  4. Follow the onscreen instructions to configure the integration.

Structure and Files

Your bucket’s directory structure and files will be named using the following patterns:

JSON
appKey + “/” + integrationId + “/JSON/” + year + “_” + month + “_” + day + “/” + year + “_” + month + “_” + day + “_” + hour + “_” + minute + “_” + second + “.json”

There will be one file generated per hour, assuming a relevant event occurred within that hour.

 Note

File size maximum is 15 GB. If the volume of events for an app results in a file exceeding 15 GB, you may instead see multiple files.

Sample File

This integration provides RTDS data as line-delimited JSON objects in hourly batches as described above, as of the implementation date/time. Here are a few lines from a sample JSON file:

{"id":"0000017f-da30-7443-6712-c751b74e9063","offset":"1000042135016","occurred":"2022-03-30T09:38:02.947Z","processed":"2022-03-30T09:38:02.976Z","body":{"payload":"eyJhdWRpZW5jZSI6ImFsbCIsImRldmljZV90eXBlcyI6WyJpb3MiLCJhbmRyb2lkIiwiYW1hem9uIl0sIm5vdGlmaWNhdGlvbiI6eyJhbWF6b24iOnsiZXh0cmEiOnsiY29tLnVyYmFuYWlyc2hpcC5yZW1vdGUtZGF0YS51cGRhdGUiOiJ0cnVlIn19LCJhbmRyb2lkIjp7ImV4dHJhIjp7ImNvbS51cmJhbmFpcnNoaXAucmVtb3RlLWRhdGEudXBkYXRlIjoidHJ1ZSJ9fSwiaW9zIjp7ImNvbnRlbnRfYXZhaWxhYmxlIjp0cnVlLCJleHRyYSI6eyJjb20udXJiYW5haXJzaGlwLnJlbW90ZS1kYXRhLnVwZGF0ZSI6InRydWUifX19LCJvcHRpb25zIjp7Il9fZG9fbm90X3JlcG9ydCI6dHJ1ZSwiYnlwYXNzX2ZyZXF1ZW5jeV9saW1pdHMiOnRydWV9fQ==","push_id":"183ac190-b00d-11ec-a673-0242c76ec74c","resource":"PUSH","trimmed":false},"type":"PUSH_BODY"}
{"id":"18468161-b00d-11ec-851c-0242c8a3fe5a","offset":"1000042135017","occurred":"2022-03-30T09:38:02.998Z","processed":"2022-03-30T09:38:03.071Z","device":{"android_channel":"be5697cf-19ad-474a-9454-9451b0781282","channel":"be5697cf-19ad-474a-9454-9451b0781282","device_type":"ANDROID","named_user_id":"jarofghosts"},"body":{"push_id":"183ac190-b00d-11ec-a673-0242c76ec74c","alerting":false},"type":"SEND"}
{"id":"184a03d4-b00d-11ec-b185-02425ebb82b6","offset":"1000042135018","occurred":"2022-03-30T09:38:03.021Z","processed":"2022-03-30T09:38:03.076Z","device":{"android_channel":"cd007034-c302-4e66-84c1-f4a4d73626a5","channel":"cd007034-c302-4e66-84c1-f4a4d73626a5","device_type":"ANDROID","named_user_id":"angrr"},"body":{"push_id":"183ac190-b00d-11ec-a673-0242c76ec74c","alerting":false},"type":"SEND"}
{"id":"184f0ce3-b00d-11ec-851c-0242c8a3fe5a","offset":"1000042135019","occurred":"2022-03-30T09:38:03.054Z","processed":"2022-03-30T09:38:03.074Z","device":{"android_channel":"3719d69f-8cc8-4e15-9e93-07eeef19054d","channel":"3719d69f-8cc8-4e15-9e93-07eeef19054d","device_type":"ANDROID"},"body":{"push_id":"183ac190-b00d-11ec-a673-0242c76ec74c","alerting":false},"type":"SEND"}
{"id":"184b8a79-b00d-11ec-82cb-02421f49f457","offset":"1000042135020","occurred":"2022-03-30T09:38:03.031Z","processed":"2022-03-30T09:38:03.072Z","device":{"android_channel":"6f1e5dba-d613-4d92-ae57-e9d752b3fb48","channel":"6f1e5dba-d613-4d92-ae57-e9d752b3fb48","device_type":"ANDROID","named_user_id":"gemma"},"body":{"push_id":"183ac190-b00d-11ec-a673-0242c76ec74c","alerting":false},"type":"SEND"}
{"id":"184dfb71-b00d-11ec-bba4-0242374bcd23","offset":"1000042135021","occurred":"2022-03-30T09:38:03.047Z","processed":"2022-03-30T09:38:03.079Z","device":{"android_channel":"cd4b40f9-6552-4dc6-9075-3f382ccf643f","channel":"cd4b40f9-6552-4dc6-9075-3f382ccf643f","device_type":"ANDROID","named_user_id":"meghan","attributes":{"locale_variant":"","app_version":"2021-10-04T180745-goat","device_model":"Nokia 6.1","connection_type":"WIFI","app_package_name":"com.urbanairship.goat","iana_timezone":"America/New_York","push_opt_in":"false","locale_country_code":"US","device_os":"10","locale_timezone":"-14400","locale_language_code":"en","location_enabled":"true","background_push_enabled":"true","ua_sdk_version":"15.0.0","location_permission":"ALWAYS_ALLOWED"}},"body":{"push_id":"183ac190-b00d-11ec-a673-0242c76ec74c","alerting":false},"type":"SEND"}
{"id":"184b8a75-b00d-11ec-82cb-02421f49f457","offset":"1000042135022","occurred":"2022-03-30T09:38:03.031Z","processed":"2022-03-30T09:38:03.073Z","device":{"android_channel":"2ffae649-4f28-4ed8-a11f-323a65f585f3","channel":"2ffae649-4f28-4ed8-a11f-323a65f585f3","device_type":"ANDROID","named_user_id":"lhf"},"body":{"push_id":"183ac190-b00d-11ec-a673-0242c76ec74c","alerting":false},"type":"SEND"}

Use Cases

Once you have set up your Google Cloud Storage integration, your Airship data will be directed into your storage bucket once per hour. From there, how you use the data is up to you, but some potential ideas are:

  • Output files with user-level send and open information, and import these files into your CRM system.
  • Combine output data with Google Big Query to perform detailed analysis of your users.
 Tip

Be sure to regularly audit your Airship Google Cloud bucket. Real-Time Data Streaming outputs large amounts of data, which can lead to expensive Google Cloud bills if not managed appropriately.