All things Shopify and commerce
Hello,
I have implemented a shopify web_pixel and am listening to checkout_completed events.
When receiving the event, is there any way to get shop information, like shop_id or Shopify.shop value or ".myshopify" domain name
I am subscribing to event as follows
Did you find a workaround?
Create a field in your extension.toml, something like:
[settings.fields.shopID]
name = "Shop ID"
description = "Shop ID"
type = "single_line_text_field"
Then when you call the webPixelCreate set the settings variable similar to the following:
{
"webPixel": {
"settings": "{\"shopID\":\"mystore.myshopify.com\"}"
}
}
After that the shopID variable will be available inside the pixels settings param.
register(async ({ analytics, browser, settings, init }) => {
// Bootstrap and insert pixel script tag here
const shopID = settings.shopID;
}
This returns .myshopify domain
init?.data?.shop?.myshopifyDomain
Hey yes it did, thanks for help!
In my custom web pixel the init.data.shop object is completely missing. Is there a specific set of circumstances where the shop field is not available? I'm listening to the checkout_completed event.
I think you checked event.data, not init.data.
I'm an idiot, thank you 😅
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024