Meta Signals Gateway: JavaScript Code for Event ID
Benjamin Mangold
You can find the custom JavaScript code for the Google Tag Manager Event ID variable below.
Important: You will need to change the ID included in the code to reflect the container it is installed it. Look for 'GTM-ABC123' and replace it with your container ID.
// IMPORTANT: Correct container ID needs to be included belowfunction() { var eventId = window.google_tag_manager['GTM-ABC123'].dataLayer.get('gtm.uniqueEventId'); window._eventIds = window._eventIds || {}; if (!window._eventIds[eventId]) { window._eventIds[eventId] = Date.now().toString(36) + Math.random().toString(36).substring(2, 10); } return window._eventIds[eventId];}
