--- title: AnalyticsTarget - GraphQL Admin description: A target for an analytics metric. api_version: unstable api_name: admin source_url: html: 'https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTarget' md: >- https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTarget.md --- # Analytics​Target object Requires `read_reports` access scope. A target for an analytics metric. ## Fields * created​At [Date​Time!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/DateTime) non-null The date and time the target was created. * currency​Code [String!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) non-null The currency code associated with the target. * end​Date [Date!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Date) non-null The end date of the target period. * expected​Value [Decimal!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Decimal) non-null The expected value for the target. * filters [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) The WHERE clause filters for the target. * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) non-null A globally-unique ID. * metric [String!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) non-null The metric identifier this target tracks. * name [String!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) non-null The name of the target. * presentment​Expected​Value [Money​V2](https://shopify.dev/docs/api/admin-graphql/unstable/objects/MoneyV2) The expected value converted to a specified currency. * currency​Code [Currency​Code!](https://shopify.dev/docs/api/admin-graphql/unstable/enums/CurrencyCode) required ### Arguments The currency code to convert the expected value to. *** * shopifyql​Query [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) A ShopifyQL query string to fetch the current metric value for this target. * start​Date [Date!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Date) non-null The start date of the target period. * updated​At [Date​Time!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/DateTime) non-null The date and time the target was last updated. *** ## Map ### Fields and connections with this object * [AnalyticsTargetConnection.nodes](https://shopify.dev/docs/api/admin-graphql/unstable/connections/AnalyticsTargetConnection#returns-nodes) * [AnalyticsTargetEdge.node](https://shopify.dev/docs/api/admin-graphql/unstable/objects/AnalyticsTargetEdge#field-AnalyticsTargetEdge.fields.node) *** ## Queries * [analytics​Targets](https://shopify.dev/docs/api/admin-graphql/unstable/queries/analyticsTargets) query A list of analytics targets for the shop. * first [Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int) ### Arguments The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * after [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * last [Int](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int) The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql). * before [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql). * reverse [Boolean](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean) Default:false Reverse the order of the underlying list. * sort​Key [Analytics​Target​Sort​Keys](https://shopify.dev/docs/api/admin-graphql/unstable/enums/AnalyticsTargetSortKeys) Default:ID Sort the underlying list using a key. If your query is slow or returns an error, then [try specifying a sort key that matches the field used in the search](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations). * query [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax). * * default string * end\_date date * filters string * id id * metric string * name string * start\_date date - Filter by a case-insensitive search of multiple fields in a document. - Example: * `query=Bob Norman` * `query=title:green hoodie` Filter by the end date of the target period. - Example: * `end_date:2026-03-31` * `end_date:<=2026-03-31` Filter by the WHERE clause filters of the target. - Example: * `filters:"WHERE country = 'US'"` Filter by `id` range. - Example: * `id:1234` * `id:>=1234` * `id:<=1234` Filter by metric identifier. - Example: * `metric:total_sales` Filter by target name. - Example: * `name:Q1 Sales Target` Filter by the start date of the target period. Example: * `start_date:2026-01-01` * `start_date:>=2026-01-01` *** *** ## AnalyticsTarget Queries ### Queried by * [analytics​Targets](https://shopify.dev/docs/api/admin-graphql/unstable/queries/analyticsTargets) *** ## Mutations * [analytics​Target​Create](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetCreate) mutation Create a new analytics target. * input [Analytics​Target​Create​Input](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/AnalyticsTargetCreateInput) ### Arguments The input fields for creating an analytics target. * metric [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) Deprecated * start​Date [Date](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Date) Deprecated * end​Date [Date](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Date) Deprecated * expected​Value [Decimal](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Decimal) Deprecated * name [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) Deprecated * currency​Code [Currency​Code](https://shopify.dev/docs/api/admin-graphql/unstable/enums/CurrencyCode) Deprecated * filters [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) Deprecated *** * [analytics​Target​Update](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetUpdate) mutation Updates an analytics target. * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the analytics target to update. * input [Analytics​Target​Update​Input](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/AnalyticsTargetUpdateInput) The input fields for updating an analytics target. * metric [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) Deprecated * start​Date [Date](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Date) Deprecated * end​Date [Date](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Date) Deprecated * expected​Value [Decimal](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Decimal) Deprecated * name [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) Deprecated * currency​Code [Currency​Code](https://shopify.dev/docs/api/admin-graphql/unstable/enums/CurrencyCode) Deprecated * filters [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) Deprecated *** *** ## AnalyticsTarget Mutations ### Mutated by * [analytics​Target​Create](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetCreate) * [analytics​Target​Update](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/analyticsTargetUpdate) *** ## Interfaces * [Node](https://shopify.dev/docs/api/admin-graphql/unstable/interfaces/Node) interface *** ## AnalyticsTarget Implements ### Implements * [Node](https://shopify.dev/docs/api/admin-graphql/unstable/interfaces/Node)