IBM/run-campaigns-target-customers

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

Homepage:

Size: 17274

Language: Jupyter Notebook

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Determine target audience and run marketing campaigns

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:

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.

  1. The Object storage stores the data.
  2. Data is utilized as csv files.
  3. The Jupyter notebook processes the data and generates the target audience.
  4. The Jupyter notebook is powered by Spark.
  5. The target audience information is sent to Watson campaign automation(WCA) to run campaigns.
Included components
Featured technologies

Watch the Video

Steps

Follow these steps to setup and run this developer journey. The steps are described in detail below.

  1. Sign up for Watson Studio
  2. Create contacts database in Watson Campaign Automation
  3. Create campaign contact list in Watson Campaign Automation
  4. Create campaign mailing template in Watson Campaign Automation
  5. Configure application access in Watson Campaign Automation
  6. Create the notebook
  7. Add the data
  8. Update the notebook with service credentials
  9. Update Watson Campaign Automation URLs and credentials in the notebook
  10. Run the notebook
  11. Analyze the results
1. Sign up for Watson Studio

Sign up for IBM's Watson Studio.

2. Create contacts database in Watson Campaign Automation

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.

3. Create campaign contact list in Watson Campaign Automation

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.

4. Create campaign mailing template in Watson Campaign Automation

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.

5. Configure application access in Watson Campaign Automation

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.

6. Create the notebook

7. Add the data
Add the data to the notebook

8. Update the notebook with service credentials
Add the Object Storage credentials to the notebook

9. Update Watson Campaign Automation URLs and credentials in the notebook
Enter the access token generation URL,client id, client secret and refresh token in section 5.

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.

Enter the url, database id, contact list id and template id noted in sections 2,3 and 4

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.

9. Run the notebook

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:

There are several ways to execute the code cells in your notebook:

For this Notebook, you can simply Run All cells.

10. Analyze the results

Once the notebook execution is complete, an email is sent to all the contacts in the contact list campaign_canned_food_contact_list.

Troubleshooting

See DEBUGGING.md.

License

Apache 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.