Solved

how to create the web pixel using the admin api grapql

1080
Shopify Partner
296 9 50

Hi I want to create the app pixel and it was auto enable it.

I am following the  https://shopify.dev/docs/api/admin-graphql/unstable/mutations/webPixelCreate 

not able to create the Web pixel.

what is the account id input need to pass ?

Accepted Solution (1)
1080
Shopify Partner
296 9 50

This is an accepted solution.

just I change the my code 

 webPixelInput: {
          settings: JSON.stringify({
            "accountID": 'Account_ID_45466_this_is_as_per_toml'           
          }),
        },


it was working fine.

@Liam   Thanks for the answers, no need to create the marketing activity. I am confirm that. 

View solution in original post

Replies 8 (8)
1080
Shopify Partner
296 9 50

@Stephen-Charles  Are you using the Graph QL ?  can you please add more detail answers ??

Liam
Shopify Staff
2731 302 783

The accountId input in the webPixelCreate mutation refers to the ID of the associated MarketingActivity. This ID is a unique identifier that Shopify assigns to the MarketingActivity when it is created.

 

To get the accountId, you need to create a marketing activity for your app first. You can do this by using the marketingActivityCreate  mutation. Once you've created a marketing activity, you'll be able to see the ID in the response.  You can see an example of this in our developer docs here

 

Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

1080
Shopify Partner
296 9 50

@Liam  Thanks lot for the your answers.
can you please give more detail what are the steps are required to create the app pixel and auto connected  with store.

also not mention shopify Document   https://shopify.dev/docs/apps/marketing/pixels/getting-started#step-5-create-a-web-pixel-setting-for...

shopify document was good but sometime not finding the relevant information.

Liam
Shopify Staff
2731 302 783

Are you having issues when you follow step 4 here?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

1080
Shopify Partner
296 9 50

@Liam  steps 4 still i have complete successfully.
I have an issue with the  step5  

1080
Shopify Partner
296 9 50

@Liam  here is screenshot of the code i am doing. Screenshot from 2023-09-18 12-07-36.pngwebpixel; error - Screenshot from 2023-09-13 16-53-51.png

1080
Shopify Partner
296 9 50

This is an accepted solution.

just I change the my code 

 webPixelInput: {
          settings: JSON.stringify({
            "accountID": 'Account_ID_45466_this_is_as_per_toml'           
          }),
        },


it was working fine.

@Liam   Thanks for the answers, no need to create the marketing activity. I am confirm that. 

Deep0617
Shopify Partner
28 0 6

@1080 Thank you