Skip to main content
ZenHub houses documentation to support you if you’re using Contensis Classic. Contensis Classic includes our WYSIWYG and templating features. If you’re working with a newer version of Contensis, is your go-to place to find anything Contensis-related when building with content types.

Query log data

When a page is tracked or data is captured we store logs of the information which can be queried using the API. A basic query for all the records for a contact with a given tracking id would be as follows:

This would query will return a PagedList of ContactLog.

Page List contains the following properties:

Name Description
Items An enumerable list of items
PageSize The page size requested in the query
PageIndex The page index requested in the query
TotalCount The total number of results found

The returned information gives us a tracked page log and explicit data logs, we can also see that we have a total count of records. Paging can be managed by using the PageIndex and PageSize properties of the query request.

Extending the query

Explicit Data

If we are interested in explicit capture we can add extend the query as follows, which returns a collection of ExplicitDataLog:

Implicit Data (TrackedPageLog)

To get a collection of TrackedPageLog items we can use:

Retrieving custom data

In order to retrieve values for a given contact where a custom field has been set we would query as follows:

Query Operators

Operator Example
Op.And ( 
Op.EqualTo("first", 1), 
Op.EqualTo("second", 2)
This would return any document where first is 1 AND second is 2.
Op.Between("first", 7, 15)
In the above example if our field is between 7 and 15 (inclusive) it would match.
Op.Contains("stringField", "test")
In the above example if our field contains the word test it would match.
Op.EndsWith("wordField", "ing")

In the above example if our field contains a word ending with ‘ing’ it would match.
Op.EqualTo("first", 1)
Op.Exists("fieldName", true)
In the above example any document that has a field called fieldName would be returned. You can use a value of false if you want documents that do not contain a given field.
Op.GreaterThan("first", 7)
Op.GreaterThanOrEqualTo("first", 7)
Op.Between("first", 1, 7, 15, 22)
In the above example any document that where the field first is equal to 1,7,15 or 22 would be returned.
Op.LessThan("first", 7)
Op.LessThanOrEqualTo("first", 7)
Op.Not(Op.EqualTo("first", 7))
The not expects an inner operator so in the above example any document where first is not equal to 7 would be returned.
Op.Or (
 Op.EqualTo("first", 1),
 Op.EqualTo("second", 2)
This would return any document where first is 1 OR second is 2.
Op.StartsWith("wordField", "goo")
In the above example if our field contains a word starting with ‘goo’ it would match.