# webPixel - admin-graphql - QUERY Version: 2024-10 ## Description Returns a [web pixel](https://shopify.dev/docs/apps/build/marketing-analytics/build-web-pixels) by ID. ### Access Scopes ## Arguments * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID - The ID of the `WebPixel` object to return. ## Returns * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID! A globally-unique ID. * [settings](/docs/api/admin-graphql/2024-10/scalars/JSON): JSON! The [settings object](https://shopify.dev/docs/apps/build/marketing-analytics/build-web-pixels#step-2-define-your-web-pixel-settings) for the web pixel. This object specifies configuration options that control the web pixel's functionality and behavior. You can find the settings for a web pixel in `extensions//shopify.extension.toml`. ## Examples ### Query a web pixel Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { webPixel { id settings } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n webPixel {\n id\n settings\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n webPixel {\n id\n settings\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n webPixel {\n id\n settings\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n webPixel {\n id\n settings\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "webPixel": { "id": "gid://shopify/WebPixel/845285844", "settings": "{foo2: 'bar2'}" } } } ### Query a web pixel by its ID Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { webPixel(id: \\\"gid://shopify/WebPixel/845285844\\\") { id settings } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n webPixel(id: \"gid://shopify/WebPixel/845285844\") {\n id\n settings\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n webPixel(id: \"gid://shopify/WebPixel/845285844\") {\n id\n settings\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n webPixel(id: \"gid://shopify/WebPixel/845285844\") {\n id\n settings\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n webPixel(id: \"gid://shopify/WebPixel/845285844\") {\n id\n settings\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "webPixel": { "id": "gid://shopify/WebPixel/845285844", "settings": "{foo2: 'bar2'}" } } }