tl;dr
Creating a dev pixel extension but running Graph Mutation says scopes are missing. Confirmed scopes were added.
Issue
I’m trying to get a development instance of a web pixel app extension to work with my app and dev store.
I followed all of the steps in the “Getting started with web pixel app extensions” guide.
- Steps 1 - 5 went smooth
- I re Oauth’d my app with all the necessary scopes succesfully
- Confirmed the .toml file has the scopes defined
- Deployed and published the app;
- Confirmed app is using 2022-10 API version
On my dev shop, it shows installed and the pixel is listed under “Apps” in Customer Events.
Step 6 of the guide says to run a mutation to update the field that is defined in the example code. When I run the mutation I get:
Access denied for webPixelCreate field. Required access: `write_pixels` access scope. Also: The app requires read_customer_events access scope and user access permission.",
However, doing a GET to the admin scopes API endpoint it returns
{
"access_scopes": [
{
"handle": "write_pixels"
},
{
"handle": "read_customer_events"
},
{
"handle": "read_products"
},
{
"handle": "read_pixels"
}
]
}
So the scopes are there. Visiting my dev shop I don’t see any of my pixel code loaded - even when just adding a console.log, nothing appears in console.
Troubleshooting
I’ve uninstalled/reinstalled my app.
Verified API version is 2022-10.
Confirmed correct scopes are authorized.
Confirmed pixel code is asking for correct scopes in .toml file
Tried setting scopes as ENV values as well.
Dev Pixel Code
import { register } from "@shopify/web-pixels-extension";
console.log('Loading extension...');
register(({ configuration, analytics, browser }) => {
console.log('registered...');
analytics.subscribe('page_viewed', (event) => {
console.log('page_viewed', event);
})
analytics.subscribe('product_viewed', (event) => {
console.log('product_viewed', event);
})
});
Any thoughts on what’ i’m missing?