The filter map supports the concept of defaults at each object level. When CCStoreConfiguration cannot find a match for a piece of data in the context object, it looks for a default. If it finds a default, it searches within that default object’s children for the next piece of data in the priority list. If it cannot find a match or a default, it will not return a response filter key.
The concept of default objects can exist at any level in a filter map. For example, consider this filter map that sets its priority list to ["endpoint","page","identifier","viewport"]:
var newFilterMap = {
"endpoint1": {
"page1":{"cc-filter-config-key": "key1"},
"page2":{"cc-filter-config-key": "key2"},
"page3":{
"identifier1":{"cc-filter-config-key": "key3"},
"identifier2":{"cc-filter-config-key": "key4"},
"cc-filter-config-key": "key11",
"default":{
"viewport1":{"cc-filter-config-key": "key5"},
"viewport2":{"cc-filter-config-key": "key6"},
"default":{"cc-filter-config-key": "key7"}
}
},
"cc-filter-config-key": "key8",
"default":{
"identifier1":{"cc-filter-config-key": "key9"},
"default":{"cc-filter-config-key": "key10"}
}
}
};The following table lists a variety of sample context objects and the response filter key that would be returned for them based on this filter map:
Context Object Data | Filter Key Returned |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

