Name: run-campaigns-target-customers
Owner: International Business Machines
Description: Integrate Watson Studio and Watson Campaign Automation to tailor your target audience for effective campaigns
Created: 2018-05-06 00:54:24.0
Updated: 2018-05-17 08:02:14.0
Pushed: 2018-05-17 08:02:19.0
Size: 17274
Language: Jupyter Notebook
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A business runs marketing campaigns to promote products with the objective of boosting revenues. The campaigns need to be run on appropriate audiences for maximum impact. A consumer not interested in a product will ignore the campaign offer.
There are two steps to running a marketing campaign:
Identifying the target audience - The target audience can be determined by analyzing the purchases and browsing history of customers, social media posts, reviews and other data sources. This will help identify customers who could be interested in a product.
Run campaigns(e-mail, sms, phone etc.) on target audience.
In this pattern, the following aspects are covered:
The customer demographics and sales data available here is used to demonstrate the above. The sales data includes multiple categories of products. For this pattern, we demonstrate identifying the target audience and running a campaign for Canned Foods.
When the reader has completed this pattern, they will understand how to:
The intended audience for this code pattern are Developers and Data Scientists who want to build an end to end marketing campaign solution for a business.
IBM Watson Studio: Analyze data using RStudio, Jupyter, and Python in a configured, collaborative environment that includes IBM value-adds, such as managed Spark.
IBM Cloud Object Storage: An IBM Cloud service that provides an unstructured cloud data store to build and deliver cost effective apps and services with high reliability and fast speed to market.
Watson campaign automation: Smarter marketing automation across all digital channels, powered by Watson.
Data Science: Systems and scientific methods to analyze structured and unstructured data in order to extract knowledge and insights.
Marketing automation: Software platforms and technologies designed for marketing departments and organizations to more effectively market on multiple channels online (such as email, social media, websites, etc.) and automate repetitive tasks.
Follow these steps to setup and run this developer journey. The steps are described in detail below.
Sign up for IBM's Watson Studio.
Login to the Watson campaign automation instance.
Select Data
and then Databases
. Select Shared
and click Create
.
Configure the database by entering a name wdp_wca_db
. Click on Next
.
Click on Create
to create the database.
Select Data
and then Databases
. Click View
to view the list of databases.
Click on the database wdp_wca_db
.
Note the database id.
Select Data
and then Contact Lists
. Click on Create Contact List
.
Configure the campaign list by selecting the parent database as wdp_wca_db
. Enter a name campaign_canned_food_contact_list
. Click OK
.
Select Data
and then Contact Lists
. Click View
to view the list of contact lists.
Click on the list campaign_canned_food_contact_list
.
Note the contact list id.
Click on Content
. Under Create Mailings
click on Mailing Template
.
Select the Welcome Simple
mailing template.
Click to open the selected mailing template. Click Open
to customize the mailing template.
Click on Select Contacts
and select campaign_canned_food_contact_list
. Click Done
.
Customize the template as shown below and change the name to CannedFoodsCampaignJune2018
. Click on Save
.
Click on Content
. Under View Mailings
click on Templates
.
The list of templates can be seen. Hover the mouse over CannedFoodsCampaignJune2018
and note the template id.
Login to the Watson Campaign Automation instance. Go to Settings
and select Organization Settings
.
Goto Application Account Access
and click Add Application
.
Add an application name customer_insights_wstudio
and click Add
.
Note the client id and client secret. Click Close
.
Click on Add Account Access
.
Select the application customer_insights_wstudio
and click Add
.
A refresh token is sent to the registered email-d. Please note the refresh token.
Tools
and select Notebook
.From URL
tab.Create
button.customer_orders.csv
Find and Add Data
(look for the 10/01
icon)
and its Files
tab.browse
and navigate to where you downloaded customer_orders.csv
on your computer.2.1 Add your service credentials for Object Storage
section in the notebook to update the credentials for Object Store.Find and Add Data
(look for the 10/01
icon) and its Files
tab. You should see the file names uploaded earlier. Make sure your active cell is the empty one created earlier.Insert to code
below customer_orders.csv
.Insert Crendentials
from the drop down menu.credential_2
change them to credentials_1
.Replace the <BASE_URL>
with the base url for the Watson Campaign Automation instance.
Add the client id, client secret and refresh token noted in section 5.
Replace the <BASE_URL>
with the base url for the Watson Campaign Automation instance. The <BASE_URL>
specified here can be different from the <BASE_URL>
entered previously for getting access tokens.
Enter the database id , contact list id and template id we noted in sections 2,3 and 4.
When a notebook is executed, what is actually happening is that each code cell in the notebook is executed, in order, from top to bottom.
Each code cell is selectable and is preceded by a tag in the left margin. The tag
format is In [x]:
. Depending on the state of the notebook, the x
can be:
blank
, this indicates that the cell has never been executed.number
, this number represents the relative order this code step was executed.*
, this indicates that the cell is currently executing.There are several ways to execute the code cells in your notebook:
Play
button in the toolbar.Cell
menu bar, there are several options available. For example, you
can Run All
cells in your notebook, or you can Run All Below
, that will
start executing from the first cell under the currently selected cell, and then
continue executing all cells that follow.Schedule
button located in the top right section of your notebook
panel. Here you can schedule your notebook to be executed once at some future
time, or repeatedly at your specified interval.For this Notebook, you can simply Run All
cells.
Once the notebook execution is complete, an email is sent to all the contacts in the contact list campaign_canned_food_contact_list
.