Tag Resolve Requests

Tag your address resolve requests with metadata for usage tracking. Tags are appended to the resolve API call (the second request that retrieves the full address when a suggestion is selected).

See Tagging and Usage Tracking for more on how tags work.

Static Tags​


AddressFinder.setup({
  apiKey: "ak_test",
  resolveOptions: {
      tags: "checkout,web"
  },
  outputFields: {
      line_1: "#line_1",
      line_2: "#line_2",
      line_3: "#line_3",
      post_town: "#post_town",
      postcode: "#postcode"
  }
});

Dynamic Tags​

Use setResolveOptions to update tags after the controller has been instantiated. This is useful when the tag value depends on user context, such as the current page or form.


const c = AddressFinder.setup({
  apiKey: "ak_test",
  resolveOptions: {
      tags: "default"
  },
  outputFields: {
      line_1: "#line_1",
      line_2: "#line_2",
      line_3: "#line_3",
      post_town: "#post_town",
      postcode: "#postcode"
  }
});

// Update tags based on which form is active
document.getElementById("form_select").addEventListener("change", (e) => {
  c.setResolveOptions({
      tags: e.target.value
  });
});