Open Platonie64 opened 3 months ago
Hello @Platonie64! I'm here to assist you with any bugs, questions, or contributions you may have. Let's squash those bugs together! 🤖
To resolve the "No event type configured" error and ensure your Facebook Pixel integration works correctly, follow these steps:
Verify Event Type Configuration:
Check URL Validity:
Replace {TRACKING_ID}
:
Update Pixel Initialization:
{TRACKING_ID}
in the pixel script with your actual Facebook Pixel ID. Here is an example of the script with the tracking ID replaced:
!function(f,b,e,v,n,t,s){
if(f.fbq)return;
n=f.fbq=function(){
n.callMethod ? n.callMethod.apply(n,arguments) : n.queue.push(arguments)
};
if(!f._fbq)f._fbq=n;
n.push=n;
n.loaded=!0;
n.version='2.0';
n.queue=[];
t=b.createElement(e);
t.async=!0;
t.src=v;
s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)
}(window,document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init','YOUR_PIXEL_ID');
fbq('trackCustom','CalcomView');
Troubleshoot the Error:
Ensure the URL format is correct and the event type exists and is not hidden. The validation steps are as follows:
const regex = new RegExp(`^${WEBSITE_URL}/`, `i`);
if (!regex.test(url)) return error;
const urlWithoutCal = url.replace(regex, "");
const urlParts = urlWithoutCal.split("/");
const usernameOrTeamSlug = urlParts[0];
const eventTypeSlug = urlParts[1];
if (!usernameOrTeamSlug || !eventTypeSlug) return error;
const potentialUsers = await prisma.user.findMany({
where: {
username: usernameOrTeamSlug,
},
include: {
eventTypes: {
where: {
slug: eventTypeSlug,
hidden: false,
},
},
},
});
const potentialTeams = await prisma.team.findMany({
where: {
slug: usernameOrTeamSlug,
},
include: {
eventTypes: {
where: {
slug: eventTypeSlug,
hidden: false,
},
},
},
});
const matchingUser = potentialUsers.find((user) => user.eventTypes.length > 0);
const matchingTeam = potentialTeams.find((team) => team.eventTypes.length > 0);
if (!matchingUser && !matchingTeam) return error;
const userOrTeam = matchingUser || matchingTeam;
const userOrTeamId = userOrTeam.id;
const eventType = await prisma.eventType.findFirst({
where: {
userId: userOrTeamId,
slug: eventTypeSlug,
hidden: false,
},
});
if (!eventType) return error;
return true;
By following these steps, you should be able to resolve the error and ensure your Facebook Pixel integration works correctly across all events [1][2].
To continue talking to Dosu, mention @dosu.
The problem is that the problem is on the public page, as if it is an event. But it's not an event. And people can't access to the calendar
@Platonie64 can you share a link to your public booking page?
I tried to install via the app facebook pixel on my calendar. Problem: the public page is viewed as an event and I got an error message : "No event type configured PLATONIE / WINE TASTING has not configured an event type that you can book."
I created one pixel per event. Is it the problem ? Do I only need to create only one pixel and put the same ID into each event ? Anyway my page is out of order, people can't access to the calendar
What could I do?