I’m working on implementing GA4 tracking through Google Tag Manager for a WordPress website that uses Gutenberg blocks. The main challenge I’m facing is getting proper analytics data from interactive elements like buttons and links that are created using Gutenberg’s block editor.
The issue seems to be that I can’t figure out how to assign custom IDs or tracking attributes to these elements. When I create a button or link through Gutenberg, I don’t see obvious options to add the necessary identifiers that Google Tag Manager needs to track user interactions properly.
Does anyone know if there’s a way to add custom HTML attributes or unique identifiers to hyperlinks and button elements when building them through the Gutenberg interface? I need this for proper event tracking in my analytics setup.