Issue with `write_pixel` access Scope

Even after including the following in the shopify.app.toml:

scopes = "write_pixels,read_customer_events,read_products,write_products"

And making store merchants grant the required conditions. When I try to run the Admin GraphQL API Mutation

webPixelCreate on the merchant store. I get the following response:

GraphQL Query:

mutation {
  webPixelCreate(configuration: "{\"accountId\":\"234\"}") {
    userErrors {
      code
      field
      message
    }
    webPixel {
      configuration
      id
    }
  }
}

The response: (Just adding the relevant part)

"message": "Access denied for webPixelCreate field. Required access: `write_pixels` access scope. Also: read_customer_events access scope required."
1 Like

Hi,

Did you re-installed your app after adding the write_prixels scope?

Yes. But that didn’t work.

I’m running into the same problem as well, so can’t enable the web pixel for testing purposes.

1 Like

I had the same issues, just delete the app using partners board, and install it back, it worked for me, just had this issues 1 day ago.

1 Like

Hey, anyone who has got the solution for this error?

Hi there @charles52 , I solved it by adding the scopes to the project_root_folder/shopify.app.toml

scopes = "write_pixels,read_customer_events"

I’ve found you need to export SCOPES before running the server for the app.

$ export | grep SCOPE
declare -x SCOPES="write_pixels,read_customer_events,read_products"
$ export SCOPE="write_pixels,read_customer_events,read_products"

You need the read_products scope because by default the shopify app needs this permission for the their test page. If you remove that functionality, it’s no longer needed.

@sirev Thanks for the answers.

if you can answer on my Query. https://community.shopify.com/post/2225672