Inx_Api_DataAccess_ClickDataQuery provides a fluent interface for retrieving click data. to filter the clicks:
Inx_Api_DataAccess_ClickDataQuery provides a fluent interface for retrieving click data. The following criteria can be used to filter the clicks:
Important note: The Inxmail Professional server will terminate any ClickDataQuery request that produces an overall result size of over ten million clicks, by default. Any request with a result size above this threshold will result in a server-side RuntimeException.
The following snippet demonstrates how simple it is to retrieve all clicks which have been performed after a certain date. The last two lines show the actual creation and execution of the query:
$oRecipientContext = $oSession->createRecipientContext(); $aAttrs = array( $oRecipientContext->getMetaData()->getEmailAttribute() ); $sStart = date( 'c', strtotime( '-1 day ) ); $oClickDataQuery = $oSession->getDataAccess()->getClickData()->createQuery( $oRecipientContext, $aAttrs ); $oClickDataRowSet = $oClickDataQuery->after( $sStart )->executeQuery();To demonstrate the power of this approach, the following snippet combines most of the available filters, thus retrieving all clicks for the given mailings, recipients and link types, which occurred during February 2013:
$oRecipientContext = $oSession->createRecipientContext(); $aAttrs = array( $oRecipientContext->getMetaData()->getEmailAttribute() ); $sStart = date( 'c', mktime( 0, 0, 0, 2, 1, 2013 ) ); $sEnd = date( 'c', mktime( 23, 59, 59, 2, 23, 2013 ) ); $aMailingIds = array( 1234, 4711 ); $aRecipientIds = array( 2, 3, 5, 7, 11, 13, 17 ); $aLinkTypes = array( Inx_Api_DataAccess_LinkDataRowSet::LINK_TYPE_UNIQUE_COUNT, Inx_Api_DataAccess_LinkDataRowSet::LINK_TYPE_OPENING_COUNT ); $oClickDataQuery = $oSession->getDataAccess()->getClickData()->createQuery( $oRecipientContext, $aAttrs ); $oClickDataRowSet = $oClickDataQuery->mailings( $aMailingIds )->recipients( $aRecipientIds )->linkTypes( $aLinkTypes )->between( $sStart, $sEnd )->executeQuery();Note: Usually, it makes no sense to filter by mailing or link type when you are already filtering by individual links, as this is just redundant information. Therefore the example above did not filter by any links. This can be achieved analogical.
For more information about click data, see the Inx_Api_DataAccess_ClickData documentation.
Located in /Api/DataAccess/ClickDataQuery.php (line 69)
Assigns an after filter (start date), overwriting any existing after filters, including those imposed by between filters.
Assigns an after filter (start date), overwriting any existing after filters, including those imposed by between filters. The result will only contain clicks performed after or at the given date.
Assigns a before filter (end date), overwriting any existing before filters, including those imposed by between filters.
Assigns a before filter (end date), overwriting any existing before filters, including those imposed by between filters. The result will only contain clicks performed before or at the given date.
Assigns a between filter (start and end date), overwriting any existing before, after and between filters. result will only contain clicks performed after or at the given start date and before or at the given end date.
Assigns a between filter (start and end date), overwriting any existing before, after and between filters. The result will only contain clicks performed after or at the given start date and before or at the given end date.
Executes the query, applying all filters and returning the resulting ClickDataRowSet.
Executes the query, applying all filters and returning the resulting ClickDataRowSet. Important note: The Inxmail Professional server will terminate any ClickDataQuery request that produces an overall result size of over ten million clicks, by default. Any request with a result size above this threshold will result in a server-side RuntimeException.
Assigns a link filter for a single link, overwriting any existing link filters. clicks on the given link.
Assigns a link filter for a single link, overwriting any existing link filters. The result will only contain clicks on the given link. Invalid link IDs will be ignored.
Assigns a link filter for several links, overwriting any existing link filters. clicks on the given links.
Assigns a link filter for several links, overwriting any existing link filters. The result will only contain clicks on the given links. Invalid link IDs will be ignored.
Assigns a link type filter for a single link type, overwriting any existing link type filters. only contain clicks on links of the given type.
Assigns a link type filter for a single link type, overwriting any existing link type filters. The result will only contain clicks on links of the given type. Invalid link types will raise an Inx_Api_IllegalArgumentException.
Assigns a link type filter for several link types, overwriting any existing link type filters. only contain clicks on links of the given types.
Assigns a link type filter for several link types, overwriting any existing link type filters. The result will only contain clicks on links of the given types. Invalid link types will raise an Inx_Api_IllegalArgumentException.
Assigns a mailing filter for a single mailing, overwriting any existing mailing filters. contain clicks on links which are part of the given mailing.
Assigns a mailing filter for a single mailing, overwriting any existing mailing filters. The result will only contain clicks on links which are part of the given mailing. Invalid mailing IDs will be ignored.
Assigns a mailing filter for several mailings, overwriting any existing mailing filters. contain clicks on links which are part of the given mailings.
Assigns a mailing filter for several mailings, overwriting any existing mailing filters. The result will only contain clicks on links which are part of the given mailings. Invalid mailing IDs will be ignored.
Assigns a recipient filter for a single recipient, overwriting any existing recipient filters. only contain clicks performed by the given recipient.
Assigns a recipient filter for a single recipient, overwriting any existing recipient filters. The result will only contain clicks performed by the given recipient. Invalid recipient IDs will be ignored.
Assigns a recipient filter for several recipients, overwriting any existing recipient filters. only contain clicks performed by the given recipients.
Assigns a recipient filter for several recipients, overwriting any existing recipient filters. The result will only contain clicks performed by the given recipients. Invalid recipient IDs will be ignored.
Assigns a sending ID filter for a single sending ID, overwriting any existing sending ID filters. only contain clicks associated with this sending.
Assigns a sending ID filter for a single sending ID, overwriting any existing sending ID filters. The result will only contain clicks associated with this sending.
Assigns a sending ID filter for several sending IDs, overwriting any exsiting sending ID filters. contain only clicks associated with these sendings.
Assigns a sending ID filter for several sending IDs, overwriting any exsiting sending ID filters. The result will contain only clicks associated with these sendings.
Documentation generated on Thu, 17 Sep 2015 14:27:22 +0200 by phpDocumentor 1.3.2