- Support Home
- Knowledge Base
- Tracking And Reporting
- Conversion Tracking
- How do I track conversions or usage for my mobile app or rich web app?
How do I track conversions or usage for my mobile app or rich web app?
Your mobile app can be configured to send usage or conversion data to Taguchi by installing our app tracking code.
Tracking usage or conversion data requires an HTTPS request to be sent from appropriate views or actions in your app. For example, conversion tracking might be initiated from a transaction confirmation screen displayed after payment has been processed. Every time a request is sent, it will count as a event within the Taguchi reporting system.
Endpoint details
Taguchi tracking requests must be sent via the GET method to the https://<client>.taguchimail.com/t/
endpoint. This endpoint supports the following query-string parameters:
Parameter | Description |
---|---|
organization_id (required) | Your numeric organization ID (Contact Taguchi support if you do not know what this is). |
event (required) | The event type to log. May be p for conversion events, wa for usage (analytics) events, ab for cart abandonment events, v for view events, or o for open events. |
data (optional) | JSON-formatted data to be saved alongside the event. This can be used for targeting or trigger processing. The maximum length of JSON data submitted using this parameter is 500 characters. |
campaign_id (optional) | The numeric campaign ID (obtained from the Taguchi user interface) to which this event should be credited. |
subscriber_id (optional) | The Taguchi subscriber ID related to this event. |
subscriber_hash (required if subscriber_id is present, ignored otherwise) | The Taguchi subscriber authentication hash corresponding to the subscriber_id value. |
email_hash (ignored if subscriber ID is present, required otherwise) | The hex-encoded SHA256 hash of the Taguchi subscriber's lowercase email address. |
The subscriber profile against which the event will be logged is determined by either subscriber_id and subscriber_hash, or by email_hash. If a matching subscriber profile is not found, the request will be ignored, but will still return a 200 OK status code. To ensure all events are logged, you can use the /public/subscriber endpoint in the Web Forms API to create the subscriber profile first.
Note that <client>
must be replaced with your click-tracking domain; contact Taguchi support if you do not know what this is.
Usage tracking
To track usage of an element or interface in your app, use a request URL similar to the following:
https://<client>.taguchimail.com/t/?organization_id=123&event=wa&data=%7B%22action%22%3A%20%22your%20action%20name%22%7D&email_hash=2f0f47c7ed07a0d1a6fe262e7ced0094b2d66032d4393dbb4aa6acbe9fd2af83
The above would save a wa (analytics) event with the data {"action": "your action name"}
to the subscriber with email address "example@example.org" in organization ID 123.
Subscribers with usage (analytics) data can be extracted using Visit Predicate.
Conversion tracking
Conversions should be submitted using the p event. The event data may include product IDs, categories, quantities and prices. Product data is automatically included in Taguchi reports if the price, quantity and cluster ID are present.
Standard Fields
The products array can include zero or more product records, each of which may include the following standard fields:
Field | Description |
---|---|
id | The product’s ID, SKU or unique name. The value can be a string or a number, but it should never be null |
clusterId | The numeric ID of the Taguchi cluster to which this product corresponds |
price | The unit price of this product |
qty | The number of this product purchased. |
Each product record may include any other data necessary for triggers or other custom integration.
In addition, custom fields can be added to the conversion record within the top-level JSON object. These fields can also be used in triggers or custom integrations.
An example conversion request containing the data {"sale": 1, "total": 24.99, "products": [{"id": "SKU001", "price": 24.99, "qty": 1}]}
is shown below:
https://<client>.taguchimail.com/t/?organization_id=123&event=p&data=%7B%22sale%22%3A1%2C%22total%22%3A24.99%2C%22products%22%3A%5B%7B%22id%22%3A%22SKU001%22%2C%22price%22%3A24.99%2C%22qty%22%3A1%7D%5D%7D&email_hash=2f0f47c7ed07a0d1a6fe262e7ced0094b2d66032d4393dbb4aa6acbe9fd2af83
Subscribers with conversion data can be extracted using Purchase History Predicate.
Data structure Examples
If you are using the data to target subscribers in the future, it's important to follow standard data structure outlined above.
i.e. Submit conversion request with the data below:
Bad Example
{"ConversionData" : [{"timestamp": "2021-01-01 12:00:00", "country" : "Australia"}], "total" : 100, "products" : [{"id": "SKU001", "price": 25.00, "qty": 1},{"id": "SKU002", "price": 37.50, "qty": 2}]}
If you want to target subscribers who purchased "SKU001" and their country is in Australia, you'd need to use target expression like below.purchased id = "SKU001", ConversionData like '%"country": "Australia"%'
To avoid this, you should use data structure in below good example. Otherwise we can set up custom transforms for the data and it will require custom development. If you have any questions, contact Taguchi Support.
Good Example
{"timestamp": "2021-01-01 12:00:00", "country" : "Australia", "total" : 100, "products" : [{"id": "SKU001", "price": 25.00, "qty": 1},{"id": "SKU002", "price": 37.50, "qty": 2}]}
With this data, you can simply target subscribers as below:purchased id = "SKU001", country = "Australia"