Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello!
We have a Checkout extensibility custom app with a dropdown select element and a button. They both have some functionality on them (line item variant change, but that's irrelevant). And I want to track them via GTM. And since it's impossible to access window.dataLayer directly from the checkout extensibility app, I got to use Pixels.
So I added so-called "custom pixel" with a simple code
analytics.subscribe("clicked", (event) => {
console.log('event clicked', event);
});
analytics.subscribe("input_changed", (event) => {
console.log('event input_changed', event);
});
What I discovered, when I click/change the select element, both clicked and input_changed events are fired as they should. But clicking the button on the other hand doesn't fire anything. I experimented with Pressable and Button components, neither of them fire anything.
Do I do something wrong here? Is there a different way to track clicks on them?
Thank you!
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025