Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Issue with `write_pixel` access Scope

Issue with `write_pixel` access Scope

prathamesht
Shopify Partner
3 0 2

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."
Replies 8 (8)

jazz-jay
Shopify Partner
96 14 17

Hi,

 

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

banned
prathamesht
Shopify Partner
3 0 2

Yes. But that didn't work.

GWInt
Visitor
1 0 1

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

sirev
Shopify Partner
15 4 3

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.

1080
Shopify Partner
301 9 66

charles52
Shopify Partner
4 0 3

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

sirev
Shopify Partner
15 4 3

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

 

 

scopes = "write_pixels,read_customer_events"

 

 

 

Barnett4321
Shopify Partner
29 0 15

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.