Looking for version 4?

Querying Visitor Activities

Supported Operations

Operation URL Format Required Parameters Description
query /api/visitorActivity/version/3/do/query?... user_key, api_key, search_criteria, result_set_criteria Returns the visitor activities matching the specified criteria parameters. See the Using Visitor Activities section for a complete description of visitor activities XML Response Formats. Also see Visitor Activity in Object Field References.

Supported Search Criteria

Search criteria may be used together in any combination and/or order unless otherwise specified. 200 visitor activities will be returned with each query request.

Parameter Datatype Options Description
created_after string today, yesterday, last_7_days, this_month, last_month, <custom_time> Selects visitor activities that were created after the specified time. If a <custom_time> is used, ensure that the specified date is formatted using GNU Date Input Syntax.
created_before string today, yesterday, last_7_days, this_month, last_month, <custom_time> Selects visitor activities that were created before the specified time. If a <custom_time> is used, ensure that the specified date is formatted using GNU Date Input Syntax.
id_greater_than integer <any_positive_integer> Selects visitor activities with IDs greater than the specified integer.
id_less_than integer <any_positive_integer> Selects visitor activities with IDs less than the specified integer.
prospect_only boolean true or false Selects visitor activities with associated prospects.
type array <comma_separated_visitor_activity_types> Selects visitor activities of the specified types. See a list of available Visitor Activity Types in Visitor Activity in Object Field References.
Relationships
campaign_id integer <any_positive_integer> Selects only visitor activities generated by assets whose campaign matches the specified ID.
custom_url_id integer <any_positive_integer> Selects only visitor activities generated by the custom redirect with the specified ID.
email_id integer <any_positive_integer> Selects only visitor activities generated by the email with the specified ID.
file_id integer <any_positive_integer> Selects only visitor activities generated by the file with the specified ID.
form_id integer <any_positive_integer> Selects only visitor activities generated by the form with the specified ID.
form_handler_id integer <any_positive_integer> Selects only visitor activities generated by the form handler with the specified ID.
landing_page_id integer <any_positive_integer> Selects only visitor activities generated by the landing page with the specified ID.
prospect_id integer <any_positive_integer> Selects only visitor activities associated with the prospect with the specified ID.
visitor_id integer <any_positive_integer> Selects only visitor activities associated with the visitor with the specified ID.

Manipulating the Result Set

Since query result sets are limited to 200 results each, the results returned may not include all the visitor activities matched by the query. To retrieve the remaining results, the following criteria can be used to navigate through the result set.

Parameter Datatype Options Description
limit integer <any_positive_integer> Specifies the number of results to be returned. Default value: 200. Note: This number cannot be larger than 200.
offset integer <any_positive_integer> Specifies the first matching visitor (according to the specified sorting order) to be returned in the query response. The first offset matching visitors will be omitted from the response. Default value: 0. Example: Specifying offset=400 will return the results starting with the 401st visitor matched by the provided criteria.
output string simple, mobile Specifies the format to be used when returning the results of the query. See XML Response Formats in Using Visitor Activities for more details.
sort_by string created_at, id, prospect_id, visitor_id Specifies the field that should be used to sort the results of the query. See Supported Sorting Options for more details. Default value: id.
sort_order string ascending, descending Specifies the ordering to be used when sorting the results of the query. The default value varies based on the value of the sort_by parameter. See Supported Sorting Options for more details.

Supported Sorting Options

The ordering of the results returned by a query request can be changed by specifying sort_by and sort_order parameters. Any of the following values are valid when specifying the sort_by parameter. For a complete list of fields involved in visitor activity queries, see VisitorActivity in Object Field References.

Value Default Sort Order Description
created_at descending Specifies that the query results should be sorted by the visitor activities' created_at timestamps.
id ascending Specifies that the query results should be sorted by the visitor activities' id fields.
prospect_id descending Specifies that the query results should be sorted by the visitor activities' related prospects.
prospect_id descending Specifies that the query results should be sorted by the visitor activities' related visitors.

XML Response Format

<rsp stat="ok" version="1.0">
    <result>
        <total_results>...</total_results>
        <visitorActivity>...</visitorActivity>
            ...
    </result>
</rsp>
Tag Description
<result> Contains the resulting visitor activities for the specified query.
<total_results> Contains the number of visitor activities selected by this query. If this value is higher than 200, then several query requests may be necessary to retrieve all of the matched visitor activities.
<visitorActivity> The data for an individual visitor activity. See Using Visitor Activities for complete descriptions of visitor activity XML Response Formats. Also see Visitor Activity in Object Field References.

Using Visitor Activities

Supported Operations

For a complete list of fields involved in visitor activity operations, see the VisitorActivity section of Object Field References.

Operation URL Format Required Parameters Description
read /api/visitorActivity/version/3/do/read/id/<id>?... user_key, api_key, id Returns the data for the visitor activity specified by <id>. is the Pardot ID for the target visitor activity.

XML Response Formats

<rsp stat="ok" version="1.0">
    <visitorActivity>
        ...
    </visitorActivity>
</rsp>
Tag Description
<visitorActivity> Parent tag. Contains data fields for target visitorActivity. For complete field listing, see Visitor Activity in Object Field References.