- App Search Guide: other versions:
- Installation
- Getting started
- Authentication
- Limits
- Users and access
- Guides
- Adaptive relevance events logs reference
- Analytics Tags
- Crawl web content
- Crawl a private network using a web crawler on Elastic Cloud
- Crawl custom fields using proxy
- Curations
- Elasticsearch search
- Elasticsearch index engines
- Create Elasticsearch index engines
- Configure dynamic field mappings and analyzers in an Elasticsearch index engine
- Elasticsearch engines text field conventions
- Facets
- Hierarchical Facets
- Indexing Documents
- Language Optimization
- Log settings
- Meta Engines
- Precision tuning (beta)
- Query Suggestions
- Search UI
- Relevance Tuning
- Result Settings
- Result Suggestions
- Role based access control (RBAC)
- Sanitization, Raw or Snippet
- Search
- Synonyms
- View web crawler events logs
- App Search web crawler
- Web crawler FAQ
- Web crawler reference
- Web crawler events logs reference
- API Reference
- Adaptive relevance API reference (beta)
- Analytics APIs
- Analytics clicks API
- Analytics counts API
- Analytics queries API
- API logs API
- Click API
- Credentials API
- Curations API reference
- Documents API
- Elasticsearch search API
- Engines API
- Log settings API
- Multi search API
- Query suggestion API
- Schema API
- Search API
- Search API boosts
- Search API facets
- Search API filters
- Search API group
- Search API precision (beta)
- Search API result fields
- Search API search fields
- Search API sort
- Search API analytics tags
- Search settings API
- Search Explain API
- Source engines API
- Synonyms API
- Web crawler API reference
- API Clients
- Configuration
- Known issues
- Troubleshooting
Analytics Tags Guide
editAnalytics Tags Guide
editEach search query can attach a tag.
A tag is an analytics
parameter:
curl -X GET '<ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/national-parks-demo/search' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer search-soaewu2ye6uc45dr8mcd54v8' \ -d '{ "query": "everglade", "analytics": { "tags": [ "i-am-a-tag" ] } }'
It will codify and group search queries for organized analytics viewing.
The query above will work in a terminal — experiment, if you’d like!
An analytics query can then filter on these tags:
curl -X GET '<ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/national-parks-demo/analytics/queries' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer private-namt1hkv7ttsawuo452sxi6s' \ -d '{ "filters": { "tag": "i-am-a-tag" } }'
After running a tagged search query a few times, the above will return...
{ "meta": { "page": { "size": 1, "current": 1 } }, "results": [ { "term": "everglade", "clicks": 0, "queries": 3 } ] }
... A count of queries that contain the i-am-a-tag
tag.
The tags filter can be applied to all three analytics endpoints:
Tags, when static, are useful.
But when you think of dynamically assigning tags, a much deeper world opens.
Consider that we are using the App Search JavaScript client:
const client = ElasticAppSearch.createClient({ endpointBase: "http://127.0.0.1:3002", searchKey: 'search-soaewu2ye6uc45dr8mcd54v8', engineName: 'national-parks-demo' }) const query = 'everglade' const options = { analytics: { tags: [ 'i-am-a-tag' ] } } client .search(query, options) .then(function(response){ console.log(response) }) .catch(function(error){ console.log(error) })
The tags array is a regular array - it can store variables:
... const options = { analytics: { tags: [ tag1, tag2 ] } } ...
How you assign these variables can be dictated by user actions.
Is someone on a mobile device, or a desktop?
Are they signed up?
Did they read a specific article or purchase a certain product?
You can determine all of the above, and so you can build tags around user groups.
Dynamic assignment can make tags very insightful.
And with the analytics/clicks
and /documents
endpoints, they become very valuable.
curl -X GET '<ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/national-parks-demo/analytics/clicks' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer private-namt1hkv7ttsawuo452sxi6s' \ -d '{ "filters": { "tag": "i-am-a-tag" } }'
The analytics/clicks
endpoint returns clicks by document_id
for the filtered tag:
{ "results": [ { "document_id": "document-1234", "clicks": 7 } ], "meta": { "page": { "size": 1, "current": 1 } } }
The /documents
endpoint, as one might expect, returns documents:
curl -X GET '<ENTERPRISE_SEARCH_BASE_URL>/api/as/v1/engines/national-parks-demo/documents' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \ -d '["document-1234"]'
{ "document_id": "document-1234", "title": "my document", ... }
The chain becomes clearer!
We can...
- Dynamically assign tags based on user actions.
- Determine which documents tagged users are clicking.
- Retrieve and display those documents.
These three simple ingredients cook up one powerful technique: personalization.
You can provide astute recommendations based on preferences expressed through search...
You can place popular products or articles on your homepage, depending on user group...
You can assign Curations to improve relevance on the fly...
The possibilities for automation are deep and the potential is vast.
And it all starts when you add a simple tag to your search queries.
You can have up to 16 tags per query.
Once created, a tag cannot be removed. Create them wisely!
You can filter by tags in the dashboard, too:
Analytics - The dropdown menu will contain all of your tags.
Read the Clickthrough API Reference to learn more.