FRAMES | NO FRAMES

 

B U S I N E S S   A N A L Y S T   10.5   R E S T    A N A L Y S I S    T A S K

Customer Prospecting Endpoint

Locates areas with nearest demography characteristics to the given profile.

 

Availability: Business Analyst Server.

 

URL Example

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/CustomerProspecting/execute

Specific Parameters

Parameter

Description

AnalysisExtent (required)

Analysis extent. Type ExtentData.

DataLayerID (required)

ID of a geography layer to get demography for analysis. Type string.

CustomerProfileDescription (optional)

Customer profile string returned by Customer Profiling endpoint. Type string.

PCAEigenValue (optional)

Eigenvalue boundary for Principal Component Analysis. Type double.

PCARankSites (optional)

Maximimum number of sites to rank with Principal Component Analysis. Type int.

ProspectingQuery (optional)

Prospecting query for manual analysis. Type string.

ProspectingType (optional)

Customer prospecting type. Type esriCustomerProspectingAnalysisType.

Default: esriCustomerProspectingPCA.

Other Parameters

Parameter

Description

OutputType (required)

Array of task output options. Options for this endpoint include rendering an output image (GetMapImage) and/or creating a feature layer for subsequent analysis (GetFeatureClass). Type array of TaskOutputType.

ActiveDatasetID (optional)

ID of the active dataset. Type string.

Default: ID of the first available dataset.

f (optional)

Response format. Type string. Available formats: HTML, JSON, XML.

Default: HTML.

IsFullErrorMessage (optional)

Mode for composing error messages. Type boolean.

Default: false.

OutputAnalysisItem (optional)

Configuration options for storing the output feature layer in the repository. This will enable viewing and working with the output result in subsequent tasks. Type esriFolderItem.

OutputSpatialReference (optional)

An option specifying the spatial reference to return the output feature layer. Type SpatialReference. If this parameter is missing, the output record set will be returned in the default spatial reference. See Get Default Spatial Reference lookup operation to query the default spatial reference.

RenderingParameters (optional)

Configuration options for rendering output when GetMapImage option is specified in the OutputType parameter. Type RenderingParameters.

ReturnGeometry (optional)

An option specifying the presence of the shape attribute in the returned record set. Type boolean.

Default: true.

token

Authentication token. This parameter is required if your Business Analyst Server is secured. Type string.

Returns

Variable of type TaskResultOutput

Remarks

The Customer Prospecting allows you to search for areas (standard geographies) that meet certain criteria. This criteria is usually determined by the Customer Profiling endpoint.

 

This task generates an output feature layer by querying a demographic data layer (for example, ZIP Codes, census tracts, block groups, and so on) based on the parameters set. This new layer will contain all the variables defined in the query and will only display features of that layer that met the query criteria.

 

The AnalysisExtent property specifies the market area to prospect. The DataLayerID property specifies the geography layer for analysis.

 

Two types of prospecting analysis are supported—Conventional Analysis and Principal Component Analysis.

 

For Conventional Analysis, either the ProspectingQuery parameter or the CustomerProfileDescription parameter should be specified. In the first case, the WHERE-clause SQL statement is manually specified. It queries for sites of the geography layer with values of attributes. In the last case, the floor and ceiling values for variables of the customer profile are used for generation the SQL query for the WHERE clause. Conditions for every variable of the profile are joined using the logical and operation.

 

For Principal Component Analysis, the CustomerProfileDescription parameter should be specified. It defines the customer profile with average values for profiled variables used as a benchmark. The geography sites are ranked by similarity with this benchmark. The PCARankSites parameter can specify the maximum number of sites to be ranked. If this parameter is omitted, all sites are ranked. The PCAEigenValue parameter specifies the eigenvalue boundary for Kaiser Criterion used in Principal Component Analysis. The default value is 1 as recommended.

How to Set Up your Query

If you want to profile the customers of a national women's clothing retail chain based on your results from the Customer Profiling tool (or internal metric), and you have determined that your customers have a median household income of $35,000, a median age of 30, and are predominately female, you could set up your query to search for these parameters at the block group level. When prospecting your customers, it is recommended that you set a range for these values, since it is unlikely you will find many (if any) block groups that would have all these specific values.

 

NOTE: These variances can be set in the Customer Profiling endpoint and you can import its output Customer Profile string into parameters of the Customer Prospecting endpoint.

 

The resultant output feature layer would contain all the block groups that met the requirements set in your Customer Profile. In other words, you would be able to see all the block groups that would be likely to contain customers that you would expect to shop at your retail stores within your market (or boundary layer).

 

Usage Tips

• Before running this endpoint, set up your customer profile using the Customer Profiling endpoint.

• Set the AnalysisExtent property to include the market to prospect.

• Run your initial customer prospecting on large geographies, such as census tracts, to get a general idea of the distribution of your potential customers. Drill down into large concentrations of these boundaries, and run the customer prospecting again using the block group level. This will allow you to create sub-markets within your primary market to focus your analysis.

Example Usage

The example below generates an analysis layer of areas of interest based on specified demographic and marketing characteristics of a given list of customers using the Principal Components Analysis option. The analysis layer is saved to the repository.

 

NOTE: See FindSimilar samples for an example of using the conventional analysis option.

 

Request

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/CustomerProspecting/execute?datalayerid=&analysisextent={++"Extent":{"spatialReference":{"wkid":4326},"xmin":-122.43,"xmax":-122.38,"ymin":37.73,"ymax":37.78}}&returngeometry=&outputspatialreference=&datahierarchy=&activedatasetid=&isfullerrormessage=&prospectingtype=&customerprofiledescription=<BACustomerProfile+Variance="10.000000"+FillingType="Floor"><Item+FieldName="TOTPOP_CY"+FieldAlias="2006+Total+Population"+FieldCategory="2006/2011+Update+Summary"Average="727.500000"+Floor="654.750000"+Ceiling="0.000000"+StdDev="279.307179"+/><Item+FieldName="HHPOP_CY"+FieldAlias="2006+Household+Population"+FieldCategory="2006/2011+Update+Summary"Average="723.500000"+Floor="651.150000"+Ceiling="0.000000"+StdDev="284.964033"+/>&prospectingquery=&pcaranksites=&pcaeigenvalue=&renderingparameters=&outputtype=&outputanalysisitem=&f=pjson

 

Response

{
  "results":
  [
    {
      "paramName":"OutputFeatureClass",
      "dataType":"GPFeatureRecordSetLayer",
      "value":
      {
        "geometryType":"esriGeometryPolygon",
        "spatialReference":
        {
          "wkid":4326
        },
        "fieldAliases":
        {
          "OBJECTID":"Object ID",
          "ID":"ID",
          "AREA_ID":"AREA_ID",
          "TOTPOP_CY":"2010 Total Population",
          "HHPOP_CY":"2010 Household Population"
        },
        "fields":
        [
          {
            "name":"OBJECTID",
            "type":"esriFieldTypeOID",
            "alias":"Object ID"
          },
          ...
          {
            "name":"HHPOP_CY",
            "type":"esriFieldTypeInteger",
            "alias":"2010 Household Population"
          }
        ],
        "features":
        [
          {
            "geometry":
            {
              "rings":
              [
                [
                  [
                    -122.428726,
                    37.771856
                  ],
                  ...
                  [
                    -122.428726,
                    37.771856
                  ]
                ]
              ],
              "spatialReference":
              {
                "wkid":4326
              }
            },
            "attributes":
            {
              "OBJECTID":1,
              "ID":"060750168003",
              "AREA_ID":"1",
              "TOTPOP_CY":732,
              "HHPOP_CY":732
            }
          },
          ...
          {
            "geometry":
            {
              "rings":
              [
                [
                  [
                    -122.429617,
                    37.750783
                  ],
                  ...
                  [
                    -122.429617,
                    37.750783
                  ]
                ]
              ],
              "spatialReference":
              {
                "wkid":4326
              }
            },
            "attributes":
            {
              "OBJECTID":3,
              "ID":"060750214001",
              "AREA_ID":"3",
              "TOTPOP_CY":741,
              "HHPOP_CY":741
            }
          }
        ]
      }
    }
  ],
  "messages":
  [
  ]
}

 

NOTE: The response has been abbreviated where "..." is noted.

 

JSON Response Example Rendered with the ArcGIS API for JavaScript

Example Usage Rendering

 

See Also

Customer Profiling Endpoint

Business Analyst Server REST Reference