Reports API Version 2 Triggers
Introduction
These trigger routes are deprecated, please use new ones Reports V2 Triggers.
A trigger represents a single tracked event in Infinity. Triggers can be made up of Online and Offline events, such as web site page views or calls. Triggers can be exported from Infinity as a list with various filters applied.
Attribution
Attribution allows you to report on call and goal data in different ways, depending on the marketing channels and sources that bring visitors to your web site. The parameters that control attribution within reports are detailed below but for general information on attribution within the Infinity platform, please refer to our Knowledge Base article.
Attribution Models
Some reports allow you to choose an attributionModelId, which defaults to zero for the “Last Click (Absolute)” model. Using a different attribution model in your reports allows you to see the effect of multiple touchpoints in visitor journeys, by attributing part or all of each goal to one or more of the marketing channels that the visitor engaged with.
Triggers List
Lists the triggers within an IGRP with the following predefined filtered reports:
Get all triggers
GET /reports/v2/triggers/all
Get all call triggers ( where trigger action is call )
GET /reports/v2/triggers/calls
Get all Hosted PBX Call User triggers ( where trigger action is callUser )
GET /reports/v2/triggers/calls/users
Get all goal triggers ( where trigger is marked as a goal )
GET /reports/v2/triggers/goals
Get all transaction triggers ( where trigger has transaction currency or goal currency fields ). callRate triggers are excluded from these reports
GET /reports/v2/triggers/transactions
Get all triggers with any transaction, call or goal details. This is a union of the three routes “calls”, “goals” and “transactions” described above.
GET /reports/v2/triggers/callsGoalsTransactions
Get all touch point triggers. This is a collection of recent land, call and goal triggers. You can only query back as far as your Installation’s trigger retention period on this route.
GET /reports/v2/triggers/touchPoints
Get all visits triggers (where trigger act are lands)
GET /reports/v2/triggers/visits
GET Params
- igrp (int) - IGRP to get triggers for.
- rootOrgId (int) OPTIONAL - Filter Segments accessible by an organisation.
- limit (int) - Limit result set, see Pagination.
- offset (int) OPTIONAL - Offset result set, see Pagination.
- sort (array) - One or more sorts, see Sort Types.
- filter (array) OPTIONAL - One or more filters, see Filter Types.
- startDate (string) OPTIONAL - Start Date to filter by, see Dates and Timezones.
- endDate (string) OPTIONAL - End Date to filter by, see Dates and Timezones.
- tz (string) OPTIONAL - Timezone to convert to, see Dates and Timezones.
- attributionModelId (int) OPTIONAL - Attribution Model ID or name to use for report. Can be ‘none’ to remove attribution data from report
- nestAttributions (int) OPTIONAL - Enables/Disables nested multiple attribution output. If disabled will return multiple rows per trigger for each attributed land.
- chType (string) OPTIONAL - Channel Type to filter by.
- excludePiiData (flag) OPTIONAL - If PII Data should be redacted. This only applies to users who have the
piiData
permission, otherwise data is always redacted. This flag has no effect for users without thepiiData
permission.
Filter Types
- rowId (int) - Row ID
- vid (string) - Visitor UUID
- ch (int) - Channel ID
- goal (int) - Goal ID
- segment (int) - Segment ID
- segmentGroupId (int) - Segment Group ID
- dgrp (int) - DGRP ID
- act (string) - Action
- triggerDatetime (datetime) - Trigger datetime in UTC. Format: “YYYY-MM-DD HH:MM:SS”
- outcomeType (string) - Outcome Type (‘N’ormal, ‘C’onversion or ‘V’oid)
- dialledPhoneNumber (string) - Dialled phone number
- srcPhoneNumber (string) - Source phone number
- destPhoneNumber (string) - Destination phone number
- ringTime (int) - Call ring time (seconds the A-leg was in ringing state)
- callDuration (int) - Call duration of A-leg (seconds the A-leg was in answered state)
- ivrDuration (int) - IVR duration (seconds between A-leg being answered and B-leg destination being set)
- queueDuration (int) - Queue duration (seconds between B-leg destination being set and bridge starting or B-leg failing)
- bridgeDuration (int) - Call bridge duration (seconds the A-leg and B-leg were bridged together)
- txr (string) - Transaction reference
- txv (string) - Transaction value
- txc (string) - Transaction currency (three-letter ISO-4217 currency code)
- txm (string) - Transaction margin
- href (string) - Web page URL (if applicable). For web based triggers this is the URL of the page that was tracked. For call triggers, this is the last URL seen before the call took place
- pageTitle (string) - Trigger page title. For calls the page title will the last page visited in the session. Currently this is only available on call event triggers.
- t (string) - Trigger Title (e.g. page title, transaction title, IVR ref, dialplan Ref, call rating)
- rec (int) - A flag indicating whether or not a call recording exists for the call
- operatorRef (string) - Login of the agent that answered a phone call
- ivrRef (string) - IVR route reference
- dialplanRef (string) - Dialplan route reference
- callRating (string) - Call rating label
- callState (string) - The hangup state of the call
- transcriptionConfidence (int) - The level of confidence (0-100) of the call transcription
- totalKeywordScore (int) - Sum of operator and contact total keyword scores
- totalOperatorKeywordScore (int) - Sum of the keyword scores spotted for operator
- totalContactKeywordScore (int) - Sum of the keyword scores spotted for contact
- operatorPositiveKeywordCount (int) - Count of positive keywords spotted on the operator leg
- operatorNeutralKeywordCount (int) - Count of neutral keywords spotted on the operator leg
- operatorNegativeKeywordCount (int) - Count of negative keywords spotted on the operator
- contactPositiveKeywordCount (int) - Count of positive keywords spotted on the contact leg
- contactNeutralKeywordCount (int) - Count of negative keywords spotted on the contact leg
- contactNegativeKeywordCount (int) - Count of neutral keywords spotted on the contact leg
- callPciDataChecked (int) - Call was checked for PCI data
- callPciDataFound (int) - PCI data was found in the call
- callSsnDataChecked (int) - Call was checked for SSN data
- callSsnDataFound (int) - SSN data was found in the call
- callPiiDataChecked (int) - Call was checked for number-based PII data
- callPiiDataFound (int) - Number-based PII data was found in the call
- callKeywordSpotting (int) - A flag indicating that keyword spotting was performed by Conversation Analytics
- callTranscription (int) - A flag indicating that transcription was performed by Conversation Analytics
Sort Types
Same fields as Filter Types, see above.
Response:
Returns a list of triggers that match the supplied filters.
Examples
Here are some examples for getting Transactions out of the API.
List the 100 most recent transactions in human readable format
https://api.infinitycloud.com/reports/v2/triggers/transactions?igrp=1&limit=100&sort[]=rowId-desc&format=debug
List the 100 most recent transactions using a specific Attribution Model
https://api.infinitycloud.com/reports/v2/triggers/transactions?igrp=1&limit=100&sort[]=rowId-desc&format=debug&attributionModelId=123
Output in JSON or XML
https://api.infinitycloud.com/reports/v2/triggers/transactions?igrp=1&limit=100&sort[]=rowId-desc&format=json&attributionModelId=123
https://api.infinitycloud.com/reports/v2/triggers/transactions?igrp=1&limit=100&sort[]=rowId-desc&format=xml&attributionModelId=123
Export to CSV
If you wanted to export to Excel via CSV you can use our CSV output format option.
However because each transaction can have multiple keywords associated to it (due to the attribution model), you need to flatten the output by disabling nested attribution data output:
https://api.infinitycloud.com/reports/v2/triggers/transactions?igrp=1&limit=100&sort[]=rowId-desc&format=debug&attributionModelId=123&nestAttributions=0
To convert this output to CSV you need to specific the fields you want in the CSV and specifiy the output format as CSV:
https://api.infinitycloud.com/reports/v2/triggers/transactions?igrp=1&limit=100&sort[]=rowId-desc&format=csv&attributionModelId=123&nestAttributions=0&display[]=act&display[]=txr&display[]=txc&display[]=txv&display[]=value&display[]=vid&display[]=triggerDatetime&display[]=attributionMatchRef&display[]=attributionChName
Retrieve all triggers
For performance reasons, results from the Infinity API are restricted to a maximum of number of rows per request. This maximum number is typically 10,000 and if you specify a higher limit value the API will return an error.
If you want a larger number of triggers then you must make multiple requests, fetching a small batch of triggers in each request. The most efficient way to do this is to sort and filter by rowId.
Start by requesting the first batch ( rowId > 0 ), record the last rowId seen in the response, and then use that to filter the next batch. Continue in this way until no rows are returned from the API.
Request the first batch:
https://api.infinitycloud.com/reports/v2/triggers/all?igrp=1&startDate=2015-05-01&endDate=2015-05-31&tz=Europe%2FLondon&sort[]=rowId-asc&limit=1000&filter[]=rowId-gt-value-0
In this request we have defined the IGRP, the date range and timezone. We have sorted the results by rowId ascending (required) and asked for no more than 1000 results (your batch size could be different but we’ve found 1000 to work well). We also requested only rowId values greater than zero. While this doesn’t actually filter the first batch (rowId is always positive), it highlights the difference in subsequent batch requests.
Check the results, noting the last rowId:
{"rowId":"141247288","triggerDatetime":"2015-05-01 00:00:01",...}
{"rowId":"141247289","triggerDatetime":"2015-05-01 00:00:02",...}
...
{"rowId":"141248744","triggerDatetime":"2015-05-01 00:19:45",...}
{"rowId":"141248745","triggerDatetime":"2015-05-01 00:19:57",...}
Note that the rowId may not start at 1 (some triggers are deleted after a certain time), there may be gaps in the rowId sequence, and that the triggerDatetime may be out of sequence with the rowId, due to the asynchronous nature of our tracking platform. The rowId will always be unique and incremental though, which is why this method works.
Use the last rowId to request the next batch (the only difference between this request and the previous request is the filtered rowId value at the end):
https://api.infinitycloud.com/reports/v2/triggers/all?igrp=1&startDate=2015-05-01&endDate=2015-05-31&tz=Europe%2FLondon&sort[]=rowId-asc&limit=1000&filter[]=rowId-gt-value-141248745
Continue in this way, changing the rowId in each request until you have worked through the whole result set and retrieve no more rows.
It is possible to retrieve all triggers from Infinity over time, e.g. to populate your own data warehouse with Infinity trigger data. To do this you can remove the date range (startDate and endDate parameters). Poll the API periodically to get new data, persisting the last seen rowId between requests so you don’t start from the beginning each time.
This method also works with other routes, e.g. to import all calls (/reports/v2/triggers/calls), or all transactions (/reports/v2/triggers/transactions).
Field Definitions
Here are a list of fields that can be returned in the Trigger List reports.
General Fields
- rowId - Internal unique auto-incrementing row ID for the trigger
- triggerDatetime - This is the date and time the trigger occurred in UTC timezone (format YYYY-MM-DD HH:MM:SS)
- igrp - The Installation Group ID this trigger belongs to
- dgrp - The Dial-In Group ID this trigger belongs to (used for phone number display triggers and call triggers)
- act - The action that was attributed to the trigger (pre-defined values are call, page, and land)
- pageTitle - Trigger page title. For calls the page title will the last page visited in the session. Currently this is only available on call event triggers.
- t - Trigger Title (e.g. page title, transaction title, IVR ref, dialplan Ref, call rating)
- segment - ID of the segment this trigger belongs to.
- segmentName - Name of the segment this trigger belongs to.
- segmentRef - Client reference for the segment this trigger belongs to.
- segmentGroupId - ID of the segment group this trigger belongs to.
- segmentGroupName - Name of the segment group this trigger belongs to.
Custom Pass-Through Fields
Triggers can have certain landing tags persisted through a Visitor’s session and stored with every subsequent trigger.
For customers with pass-through tags enabled the following variables will be available.
- pt_{tagname} - The value of the pass-through tag
Custom Fields
You can record non-session persisted variables against a trigger, these are called Custom Variables.
For customers using custom variables the following variables will be available.
- c_{varName} - The value of the custom variable
Visitors
- ip - The visitor IP address
- vid - Visitor UUID
- whois - WHOIS organization looked up from IP
- ua - User agent string of visitor
- country - Country code looked up from IP (MaxMind Countries)
- city - City name looked up from IP
- continent - Continent code looked up from IP
- res - Screen resolution of visitor
- lat - Latitude looked up from IP
- long - Longitude looked up from IP
- region - Region code looked up from IP (MaxMind Regions)
- postcode - Postcode looked up from IP (USA only)
- area - Area code looked up from IP (USA only)
- spider - If the IP is a known spider, then the spider organisation is displayed
- host - Reverse DNS lookup of IP or IP if no RDNS
- visitorType - The type of visitor either N (Normal), I (Internal) or S (Spider)
- sfWhoRef - The Salesforce lead or contact ID this visitor is associated with.
- new - New visitor
- visitorPageCount - Visitor’s page count
- visitorGoalCount - Visitor’s goal count
- visitorCallCount - Visitor’s call count
- visitorFirstDatetime - Visitor’s first visit datetime in UTC. Format: “YYYY-MM-DD HH:MM:SS”
Attribution
Attributed lands for a trigger are contained in the attributions array field.
Each attributed land can contain these fields:
- attributionLandDatetime - The date time of the attributed landing
- attributionLandRowId - The trigger rowId of the attributed landing
- attributionModelId - The attribution model that has been used
- attributionModelName - The attribution model name that has been used
- attributionModelType - The type of attribution algorithm that has been used
- attributionRatio - The split ratio that this land has contributed towards the trigger
- attributionCh - The channel of the attributed landing
- attributionChName - The name of the channel of the attributed landing
- attributionTerm - The raw search term assigned to this landing, only if SEO detection recognized a known search engine.
- attributionRef - The source reference of the attributed landing
- attributionDom - The domain of the referring URL of the attributed landing
- attributionPub - The publisher of the attributed landing
- attributionNetwork - The name of the network assigned to this landing
- attributionMatchRef - The match reference assigned to this landing
- attributionMatchType - The match type assigned to this landing
- attributionCampaign - The network campaign name assigned to this landing
- attributionAdGroup - The network ad-group name of the attributed landing
- attributionAdRef - The advert or creative ID assigned to this landing
- attributionKeywordRef - The keyword reference of the attributed landing
- attributionChType - The type of the channel of the attributed landing
- attributionGoalValue - The goal value assigned to this landing
Marketing Sources
- ch - The channel ID that the trigger belongs to
- chName - The channel name that the trigger belongs to
- chType - The channel type code
- src - The source mode that the trigger was detected from
- ref - The source reference that the trigger detected
- srcHash - The unique reference given to the landing source combination
- vref - The visitor referrer URI
- href - The HTTP referrer URI (this is the URI the visitor was viewing)
- pub - The search publisher if the SEO detection recognized a known search engine
- term - The raw search term if the SEO detection recognized a known search engine
- dom - Referrer domain for SEO/PPC lands
- network - Network being used (either Google (GAW), Microsoft adCenter (MAC), or YSM (Yahoo Search Marketing))
- matchRef - PPC Keyword, or display placement info etc
- matchType - The match type (either broad (b), phrase (p), exact (e) or content display (d))
- campaign - Network campaign name
- adGroup - Network ad group name
- adRef - Advert or creative ID
- keywordRef - Keyword reference
Phone Number Allocation
- num - The phone number displayed or called for phone number display and call triggers
- algo - The phone number allocation mode used for phone number display triggers
- attr - The phone number allocation attribution mode used for phone number display triggers
Goals and Transactions
- goal - Goal ID if the trigger qualified for a goal
- goalTitle - Goal Title if trigger qualified for a goal
- goalValue - The monetary of the goal
- goalCurrency - The currency of the value of the goal (three-letter ISO-4217 currency code)
- outcomeType - If the trigger is a goal or transaction, then this will be populated with the type of outcome it had, either N (normal), C (conversion) or V (void)
- txr - Transaction reference
- txc - Transaction currency (three-letter ISO-4217 currency code)
- txv - Transaction value
- txm - Transaction margin
Calls
For triggers with an action of “call” these are the common custom element names.
Note that Infinity’s unique call reference is stored in the txr field. If you are using post call rating with currency capture, these will be stored in the txv and txc fields.
- srcPhoneNumber - Caller ID of call
- srcPhoneNumberHash - Hashed source phone number
- ringTime - Call ring time (seconds the A-leg was in ringing state)
- callDuration - Call duration of A-leg (seconds the A-leg was in answered state)
- ivrDuration - IVR duration (seconds between A-leg being answered and B-leg destination being set)
- queueDuration - Queue duration (seconds between B-leg destination being set and bridge starting or B-leg failing)
- bridgeDuration - Call bridge duration (seconds the A-leg and B-leg were bridged together)
- telcoCode - Telcoms provider used for call
- telcoCallRef - Internal call reference provided by telco provider
- destPhoneNumber - Phone number the call was forwarded on to
- latency - Time between mapped phone number display trigger and the call in seconds (for session mode only)
- operatorRef - The operator agent that answered a phone call (if used with Infinity phone system or with Operator Code entry)
- ivrRef - IVR route reference
- dialplanRef - Dialplan route reference
- callRating - Call rating label
- callState - The hangup state of the call (see below for state descriptions)
- callDirection - The direction of the call, can be either in or out
- callStage - The stage the call was at when it ended, can be one of (ring, ivr, queue, bridge or voicemail)
- operatorRealm - The SIP domain of the call operator
- dgrpName - Name of the DGRP this call belongs to
- dgrpRef - Client reference for the DGRP this call belongs to
- callRatingId - Call Rating ID of the DGRP this call belongs to
- rec - A flag indicating whether or not a call recording exists for the call
- transcriptionConfidence - The level of confidence (0-100) of the call transcription
- totalKeywordScore - Sum of operator and contact total keyword scores
- totalOperatorKeywordScore - Sum of the keyword scores spotted for operator
- totalContactKeywordScore - Sum of the keyword scores spotted for contact
- operatorPositiveKeywordCount - Count of positive keywords spotted on the operator leg
- operatorNeutralKeywordCount - Count of neutral keywords spotted on the operator leg
- operatorNegativeKeywordCount - Count of negative keywords spotted on the operator
- contactPositiveKeywordCount - Count of positive keywords spotted on the contact leg
- contactNeutralKeywordCount - Count of negative keywords spotted on the contact leg
- contactNegativeKeywordCount - Count of neutral keywords spotted on the contact leg
- callPciDataChecked - Call was checked for PCI data
- callPciDataFound - PCI data was found in the call
- callSsnDataChecked - Call was checked for SSN data
- callSsnDataFound - SSN data was found in the call
- callPiiDataChecked - Call was checked for number-based PII data
- callPiiDataFound - Number-based PII data was found in the call
- callKeywordSpotting - A flag indicating that keyword spotting was performed by Conversation Analytics
- callTranscription - A flag indicating that transcription was performed by Conversation Analytics
- ppcAssisted - Flag to indicate whether the channel was PPC assisted
Hangup States
A hangup state is what caused the call to be ended. It is in the format of {REASON}_{LEG}
E.g.
NORMAL_CLEARING_A - This means that the A-leg (caller) triggered the end of the call normally.
The following reasons are defined:
- NORMAL_CLEARING - This cause indicates that the call is being cleared because one of the users involved in the call has requested that the call be cleared. Under normal situations, the source of this cause is not the network
- USER_BUSY - This cause is used to indicate that the called party is unable to accept another call because the user busy condition has been encountered. This cause value may be generated by the called user or by the network
- NO_ANSWER - This cause is used when the called party has been alerted but does not respond with a connect indication within a prescribed period of time
- NO_USER_RESPONSE - This cause is used when a called party does not respond to a call establishment message with either an alerting or connect indication within the prescribed period of time allocated
- ORIGINATOR_CANCEL - This cause is used when a caller hangs up before the call can be connected to the destination endpoint
- UNALLOCATED_NUMBER - This cause indicates that the called party cannot be reached because, although the called party number is in a valid format, it is not currently allocated
- PROTOCOL_ERROR - This cause is used to report a protocol error event only when no other cause in the protocol error class applies