Estoy buscando configurar el seguimiento de conversiones desde un iframe, utilizando el código gtag a continuación (que se inserta en el código iframe), pero ¿cómo configuro el objetivo en Analytics para "recibir" este evento? ¿Necesito agregar event_category, event_action, etc.?
tag.src = "https://www.googletagmanager.com/gtag/js?id=XXXXXXXXXX"; document.getElementsByTagName("head")[0].appendChild(tag); window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag("js", new Date()); gtag("event", "booking_init"); gtag("config", "YOUR_TRACKER_CODE"); document.addEventListener("click", function (e) { e.path.forEach(function (pI) { if (pI.className && pI.className.indexOf("ant-select-dropdown-menu-item") != -1) { gtag( "event", pI.firstChild.className, { value: pI.firstChild.title, } ); } if (pI.className && pI.className.indexOf("booking-form-date") != -1) { gtag("event", "booking-form-date"); } if (pI.className && pI.className.indexOf("ant-btn") != -1) { gtag("event", "button", { value: pI.innerText }); } }); });```