Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Facebook pixel #15650

Open
Platonie64 opened this issue Jul 3, 2024 · 2 comments
Open

Problem with Facebook pixel #15650

Platonie64 opened this issue Jul 3, 2024 · 2 comments
Labels
app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar 🐛 bug Something isn't working

Comments

@Platonie64
Copy link

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?

@dosubot dosubot bot added app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar 🐛 bug Something isn't working labels Jul 3, 2024
Copy link

dosubot bot commented Jul 3, 2024

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:

  1. Verify Event Type Configuration:

    • Ensure that the event type for "PLATONIE / WINE TASTING" is correctly configured and not hidden. The event type should be visible and bookable.
  2. Check URL Validity:

    • Make sure the URL being used is valid and follows the correct format. The URL should include both the username or team slug and the event type slug.
  3. Replace {TRACKING_ID}:

    • If you are using multiple pixels, ensure each pixel is correctly initialized with its unique tracking ID. However, using a single pixel ID across all events is generally recommended for simplicity and consistency.
  4. Update Pixel Initialization:

    • Replace {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');
  5. 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.

@Platonie64
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar 🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant