# Search Lens Settings

The Search Lens adds to or sets the value of a Visitor Profile attribute based on data that is present in the query string parameters of a web page. Search Lenses allow marketers to specify query string parameter values that should be collected when encountered on a page view.

## Example

Using the URL https://www.domain.com/?utm_campaign=spring-sale&utm_source=facebook&utm_medium=social as an example, the Search Lens configuration below would set the following Visitor Profile attributes:

- LAST_VISIT_SOURCE - sets the value facebook to the attribute
- VISIT_CAMPAIGNS - append the value spring-sale to the collection attribute
- LAST_VISIT_CAMPAIGN - sets the value spring-sale to the attribute

### Search Lens Configuration Example

    {
        type: "search",
        searchParameter: "utm_source",
        realtimeParameter:
        {
            name: "LAST_VISIT_SOURCE",
            isListParam: false
        }
    },
    {
        type: "search",
        searchParameter: "utm_campaign",
        realtimeParameter:
        {
            name: "VISIT_CAMPAIGNS",
            isListParam: true,
            trackLastViewed: true,
            lastViewedParameterName: "LAST_VISIT_CAMPAIGN"
        }
    }

## Search Lens Properties

Property Name | Type | Description
--- | --- | ---
type | string | Must be set to search for Search Lenses
id | string | Optional. The id for the Search Lens
name | string | Optional. The name for the Search Lens
searchParameter | string | The query string parameter name
realtimeParameter | LensParameter | The LensParameter settings for the Realtime Parameter
timeoutMs | number | Optional. A timeout in milliseconds. When specified, the Path Lens will wait the specified number of milliseconds after the RpiWebClient is initialized before evaluating the Path Lens

### LensParameter

Property Name | Type | Description
--- | --- | ---
name | string | The name for the Realtime Parameter
isListParam | boolean | A flag to specify if the Realtime Parameter value is stored as a collection
trackLastViewed | boolean | Optional. A flag to specify whether an additional Realtime Parameter will be stored with the current value from the Path Lens. Required when isListParam is true
lastViewedParameterName | string | Optional. The name for the last viewed Realtime Parameter. Required when trackLastViewed is true
valueMapEnabled | boolean | A flag to specify whether the value collected from the Path Lens should be translated through the valueMap
valueMap | Map<string, string> | Optional. A Map of value translations for the values collected from the Path Lens. Required when valueMapEnabled is true
isStrictValueMap | boolean | Optional. A flag to specify whether to use strict value map translations. When true, values not found in valueMap are not sent to RPI Realtime

# results matching ""

# No results matching ""