2

My client sells in an online marketplace like Amazon. We've setup a branded domain example.com that redirects users to her storefront page, ecommerce-site.com/example. example.com basically just serves 302 redirect responses.

She's been creating Facebook ads for her products and been tracking the ad performance w/ the ads' cost per link click. We're trying to eventually optimize the ads for cost per purchase. We've setup a postback link in the e-commerce site to example.com/facebookPostback that will send Purchase events to Facebook. For now, we're gonna optimize it for Landing page views as she builds her customer base.

What I've done is every time example.com is visited, a PageView event is sent to the Pixel we've setup for her ads.

Here's how I've been sending the event using node express:

const userData = new fbSdk.UserData()
  .setClientIpAddress(ipAddress)
  .setClientUserAgent(userAgent);
if (fbc) {
  userData.setFbc(fbc);
}
if (fbp) {
  userData.setFbp(fbp);
}

const serverEvent = new fbSdk.ServerEvent()
  .setEventName("PageView")
  .setEventTime(Math.round(new Date().getTime() / 1000))
  .setEventSourceUrl(`https://example.com${req.originalUrl}`)
  .setUserData(userData);
const eventsData = [serverEvent];
const eventRequest = new fbSdk.EventRequest(
  accessToken,
  pixelId
).setEvents(eventsData);

fbc is generated from the request's fbclid if it exists. fbp is generated is taken from the _fbp cookie. If the cookie does not exist, my server generates it. Normally, with browser-based pixel events, _fbp is generated using the client timestamp new Date().getTime()) and some random number. I've just done the same on the server-side and create a set-cookie header for it in the redirect response.

Looking at the Pixel's dashboard, all the events are being received and processed successfully with no errors in the Diagnostics tab (Browser events are from Facebook's instant experience): enter image description here

However, the events sent by the server are not being attributed to the ads. I created a separate ad without instance experience to test this out and that ad received 100 link clicks without any Landing page views.

My questions:

  • Do you guys have any idea why this isn't working? Is it because example.com is just producing redirect responses?
  • How does Facebook attribute an advertisement for a Page view and does this attribution model work with server-side PageView events?
Ram
  • 1,016
  • 4
  • 15
  • 25
  • I'm afraid the fbc and fbp cookie parameters are generated via JavaScript on the client side with the fb pixel code. I think you can't generate them by yourself. So, when the page has loaded you should parse your cookies with JavaScript, retrieve fbc and fbp, send them to node with an AJAX call and then do on node what you're already doing (send the PageView event). Not entirely sure though – Saturnix Sep 20 '20 at 20:13
  • You definitely can generate the fbc parameter from "?fbclid" and send server-side, however I’m not entirely sure about fbp. – Julian Wagner Dec 30 '20 at 22:22

1 Answers1

0

I’m having the same issue. There is an information that says this metric is in development. I would assume it doesn’t work with landing page views. I have add to cart event setup that works both having no event parameters and the same user data parameters. There are a lot of PageView Events that have a clickId, but still are not attributed.

Julian Wagner
  • 674
  • 6
  • 16