External ID for FB Pixel integration
M
Michael Walker (Goodbye Ego)
Please add the "External ID" parameter to the API call, using the Contact ID from HL when sending Conversions API or Pixel Events.
This is necessary because including the "External ID" will significantly improve the matching process for ads optimization, leading to better performance and results.
Log In
B
Ben Sharp
Trying to figure out if passing along an event id through use of a hidden field attached to a contact.
I'm using chatgpt and am not a JS expert so I was wondering if something like this would work to inject the custom field with a value. It hasn't been working for me but not sure if its a code error
<script>
document.addEventListener("DOMContentLoaded", function() {
// Wait until the form is present in the DOM
const waitForForm = setInterval(() => {
const form = document.querySelector("form input[name='fb_event_id']")?.closest("form");
if (!form) return;
clearInterval(waitForForm);
const hiddenField = form.querySelector("input[name='fb_event_id']");
if (!hiddenField) return;
form.addEventListener("submit", function() {
// Generate unique event ID
const fbEventId = "evt_" + Date.now() + "_" + Math.random().toString(36).substring(2, 10);
// Populate hidden field
hiddenField.value = fbEventId;
// Store in localStorage for pixel on next page
localStorage.setItem("fb_event_id", fbEventId);
});
}, 200); // check every 200ms until form is ready
});
</script>
I
Ihsan Khan
Passing user details as additional fields would be great as well. only if someone cares about their ads. This would be the first step towards imporving pixel installation.
S
Sam Howard
Conversions API
and
Pixel Events. - This would be extremely helpful because it would enable proper deduplication.