SMART

Overview

What is SMART?

Q2 SMART is a targeting and messaging platform that will help FI marketers target messaging in online banking (including banner ads) based on user behavior, and easily manage multiple customized promotional campaigns.

What is a Trait?

A trait is a user-level data metric or model that represents a characteristic or behavior about an online banking user. It is stored in the form of a key and value.

What is an Audience?

An Audience is a logical collection of Traits. Audiences are created by our customers in order to identify interesting groups of users that they can target in SMART or Composable Dashboard today.

How do I interact with SMART?

The SDK maintains the q2-smart package in partnership with the Q2 SMART team. You can install the q2-smart package with the q2 upgrade command and selecting the q2-smart package. This will install a package that acts as a wrapper to the internal SMART API.

Online form extensions also have a helper property that will allow for easy interaction. For example:

config = SmartTraitStoreConfig("smarttest-dev", "tps-reports")
self.smart_ts = config
audiences = await self.smart_ts.audience.get()
self.logger.debug(audiences.audience_list[0])
audience_id = audiences.audience_list[0].id
users = await self.smart_ts.audience.get_users(audience_id)
count = await self.smart_ts.audience.get_count(audience_id)

What are those values used for the configuration?

The SMART Trait Store Configs takes two values. These values are environment stack identifiers (also known as env stacks). The first value is the source, and identifies the requester. This is used for a number of things like auditing and permissions. The second value is the target. The target env stack can usually be found in the self.hq_credentials.env_stack variable.

Testing with SMART Trait Store

A mock service that simulates SMART Trait Store API is available for testing when developing in a sandbox without connecting to the real infrastructure.

Exercising the Endpoints

All v2 SMART endpoints are available at:

BASE_URL="https://dev.q2api.com/v2"

Refer to the SMART documentation under the Caliper API V2 section for all available SMART Trait Store endpoints.

Testing Traits with Mock Service

The following traits are available for testing:

Trait ID

Type

custom_trait_enum

enum

custom_trait_string

string

custom_trait_float

float

custom_trait_date

date

custom_trait_boolean_1

bool

The following traits are reserved for specific error testing:

Trait ID

Type

Simulated Error

recommendations_consumer_loan

bool

Permission error (403)

ach_batch_recency

date

Permission error (403)

zip_code

string

Permission error (403)

custom_trait_boolean_2

bool

Internal system error (500)

Testing Audiences with Mock Service

The following audiences are available for testing:

Audience Name

Audience ID

Audience Type

Audience Size

All Users

60ae3846-20fc-4ef3-a199-3d1e400d192e

Global

50,000

Users with One Favorited Account

eca69ee1-bb19-4e18-8ebf-666e79ab183c

Global

25,000

Users with Multiple Favorited Accounts

9255deee-1e4a-4a71-a71b-46b32083d1c3

Global

25,001

Empty Audience

e2a29f11-dc31-477e-92d2-4bab133f441b

FI Specific

0

FI Specific Audience

e2a29f11-dc31-477f-92d2-4bab133f441b

FI Specific

5,000

Note

You do not need any additional configuration in order to use the mock service. If you need to point to a different mock service for any reason, use the Q2SDK_SMART_URL environment variable as defined in the Configuration Settings

Developing SDK Extension

The SmartTraitStoreDemo SDK extension in our examples repo is a demo that exercises a subset of what the mock service supports (e.g. it does not cover all error scenarios or direct trait config lookup).

Deploying to a Caliper Sandbox:

  1. Ensure q2-smart is installed (q2 upgrade).

  2. Deploy the extension to a sandbox environment (q2 install).

  3. The extension dashboard provides a UI with preset test scenarios for audiences and traits.

To configure your extension to talk to the real SMART Trait Store API in production, be sure to mention in your deployment ticket that the extension will require q2msg to be enabled and that your envstack should be fetched at deploy time.