search mobile facets autocomplete spellcheck crawler rankings weights synonyms analytics engage api customize documentation install setup technology content domains user history info home business cart chart contact email activate analyticsalt analytics autocomplete cart contact content crawling custom documentation domains email engage faceted history info install mobile person querybuilder search setup spellcheck synonyms weights engage_search_term engage_related_content engage_next_results engage_personalized_results engage_recent_results success add arrow-down arrow-left arrow-right arrow-up caret-down caret-left caret-right caret-up check close content conversions-small conversions details edit grid help small-info error live magento minus move photo pin plus preview refresh search settings small-home stat subtract text trash unpin wordpress x alert case_deflection advanced-permissions keyword-detection predictive-ai sso

Tags

We have a Tags Guide, too.


Submit tags with the analytics parameter.

Tags can be used to enrich each query with unique information.

Once added, a tag cannot be removed.

You can view and filter by tags using the Analytics API or the dashboard.

tags
required
Array of strings representing the tags you'd like to apply to the query. You may submit up to 16 tags, and each may be up to 64 characters in length.
Example - Submitting a query with the analytics tags "web" and "mobile".
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/national-parks-demo/search' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer search-soaewu2ye6uc45dr8mcd54v8' \
-d '{
  "query": "everglade",
  "analytics": {
    "tags": [
      "web",
      "mobile"
    ]
  }
}'

Example - Submitting a query with the analytics tags "web" and "mobile".
import com.swiftype.appsearch.Client;
import com.swiftype.appsearch.ClientException;
import java.util.*;

Client client = new Client("host-2376rb", "search-soaewu2ye6uc45dr8mcd54v8");

String engineName = "national-parks-demo"; String query = "everglade";

Map<String, Object> analytics = new HashMap<>(); analytics.put("tags", Arrays.asList("web", "mobile"));

Map<String, Object> options = new HashMap<>(); options.put("analytics", analytics);

try { Map<String, Object> response = client.search(engineName, query, options); System.out.println(response); } catch (ClientException e) { System.out.println(e); }

Example - Submitting a query with the analytics tags "web" and "mobile".
const SwiftypeAppSearchClient = require('swiftype-app-search-node')

const client = new SwiftypeAppSearchClient('host-2376rb', 'search-soaewu2ye6uc45dr8mcd54v8')

const engineName = 'national-parks-demo' const query = 'everglade'

const options = { analytics: { tags: [ 'web', 'mobile' ] } }

client .search(engineName, query, options) .then(response => console.log(response)) .catch(error => console.log(error))

Example - Submitting a query with the analytics tags "web" and "mobile".
require 'swiftype-app-search'

host_identifier = 'host-2376rb' api_key = 'search-soaewu2ye6uc45dr8mcd54v8' client = SwiftypeAppSearch::Client.new(host_identifier: host_identifier, api_key: api_key)

engine_name = 'national-parks-demo' query = 'everglade'

options = { analytics: { tags: %w[ web mobile ] } }

begin puts client.search(engine_name, query, options) rescue SwiftypeAppSearch::ClientException => e puts e end

Example - Submitting a query with the analytics tags "web" and "mobile".
from swiftype_app_search import Client
from swiftype_app_search.exceptions import SwiftypeAppSearchError

host_identifier = 'host-2376rb' api_key = 'search-soaewu2ye6uc45dr8mcd54v8' client = Client(host_identifier, api_key)

engine_name = 'national-parks-demo' query = 'everglade'

options = { 'analytics': { 'tags': [ 'web', 'mobile' ] } }

try: print(client.search(engine_name, query, options)) except SwiftypeAppSearchError as e: print(e)

Example - Submitting a query with the analytics tags "web" and "mobile".
const client = SwiftypeAppSearch.createClient({
  hostIdentifier: 'host-2376rb',
  searchKey: 'search-soaewu2ye6uc45dr8mcd54v8',
  engineName: 'national-parks-demo'
})

const query = 'everglade'

const options = { analytics: { tags: [ 'web', 'mobile' ] } }

client .search(query, options) .then(function(response){ console.log(response) }) .catch(function(error){ console.log(error) })


Stuck? Looking for help? Contact support or check out the App Search community forum!