🎉 Try the public beta of the new docs site at algolia.com/doc-beta! 🎉
API client / Methods / Insights
Required API Key: any key with the search ACL
Method signature
$insights->user(string userToken)->convertedObjectIDs(
  string eventName,
  string indexName,
  array objectIDs
)

We released a new version of the PHP API client in public beta. Read the beta documentation for more information.

About this method # A

Send a conversion event to capture clicked items.

Use this event to track when users convert on items unrelated to a previous Algolia request. For example, if you don’t use Algolia to build your category pages, use convertedObjectIDs.

Sending this event is useful for:

Related methods:

Examples # A

1
2
3
4
5
6
7
8
9
10
$insights = Algolia\AlgoliaSearch\InsightsClient::create(
  'AJ0P3S7DWQ',
  '90dfaaf5755e694f341fe68f6e41a6d4'
);

$insights->user("user-123456")->convertedObjectIDs(
  'Product Added To Wishlist',
  'YourIndexName',
  ['objectID-1', 'objectID-2']
);

Parameters # A

Parameter Description
userToken #
type: string
pattern: [A-Za-z0-9_=+/-]{1,129}
Required

Anonymous user identifier.

See also: User Token

authenticatedUserToken #
type: string
pattern: [A-Za-z0-9_=+/-]{1,129}
Optional

Pseudonymous identifier for authenticated users.

Never include personally identifiable information in user tokens.

See also: User Token

eventName #
type: string
pattern: [\x20-\x7E]{1,64}
Required

Name of the specific event.

Format: 1-64 ASCII characters, except control characters.

To maximize the impact of your events, use consistent event names and consistent formatting—for example, “Product Added To Cart” (always in title case).

For example, you can adopt Segment’s object-action framework.

indexName #
type: string
Required

Name of the Algolia index.

Format: same as the index name used by the search engine.

Some API clients use index instead of indexName.

objectIDs #
type: array
items: string
Required

List of object identifiers for items of an Algolia index.

You can include up to 20 objectID.

Response # A

This method doesn't return a response.

Did you find this page helpful?
PHP v3