Question:
I need an element to fire a Pixel for analytics and make a phone call (please see the phone below). However, some of the Pixels aren’t registering depsite launching properly.
Product:
Wix Editor
What are you trying to achieve:
I need to fire a Pixel, ensure the Pixel registers and make a phone call on the click of a button.
What have you already tried:
I have tried the code below:
export function button_click(event) {
// This isn't the actual URL but it looks very similar.
let imageUrl = "https://testPixelEvent/?tag_id=01&buzz_key=tu&value=&segment_key=tu-0001&account_id=1&order=[ORDER]&ord=[CACHEBUSTER]"
fetch(imageUrl, {
method: 'GET'
})
.then(response => {
if (response.ok) {
console.log('Pixel fired successfully');
} else {
console.log('Failed to fire pixel');
}
})
.catch(err => {
console.error('Error firing pixel:', err);
});
// Initiate a phone call
let phoneNumber = "+1123456789";
wixLocation.to(`tel:${phoneNumber}`);
}
Additional information:
https://hub.freewheel.tv/display/BW/Events