从服务器调用Facebook像素事件 [英] Facebook pixel events call from server

查看:285
本文介绍了从服务器调用Facebook像素事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有绝对权利与 dan 相同的问题在这里 - 选项。有写的,没有办法,但是是2013年,所以我希望有所改变。

I have absolutelly the same question as dan here - Facebook conversion pixel with "server to server" option . There was written, that there was no way, but it was 2013, so I hope something changed.

所以,有什么办法调用Facebook像素事件(例如CompleteRegistration)从服务器端现在?

我可以更详细地描述情况。想象一下,那个用户访问我们的网站,当然,fb像素跟踪PageView。当用户通过表单并发送他的电话号码时,我们称之为Lead事件。但是,当我们的经理成功确认此用户时,我们还需要跟踪一个事件!当然,它发生在其他计算机上等等,所以没有任何想法,如何连接给基础用户。

I can describe situation in more details. Imagine, that user visits our site, where fb pixel tracks 'PageView' of course. When user passes form and sends his phone number, we call 'Lead' event. But then we need to track one more event, when our manager successfully confirmes this user! Of course, it happens on other computer and so on, so there is no idea, how to "connect" to base user.

我看到很多文档部门,如这个,但我不能完全理解,即使是可能的。

I've seen a lot of documentation departments like this, but I can't fully understand even if it's possible or not.

逻辑上,我们需要为用户生成特定的ID(或者真的可以是电话号码),当Lead事件被调用时。那么我们应该使用这个id来为该用户完成注册。但是我不明白,如何在技术上做到这一点。

Logically, we need to generate specific id for user (or it can be phone number really), when 'Lead' event is called. Then, we should use this id to 'CompleteRegistration' for that user. But I can't understand, how to do it technically.

如果有人可以解释一下,这将是gratefull。

It would be gratefull, if somebody could explain it.

PS据了解,它可以用于移动应用的API。如果没有其他解决方案,可以使用它吗?

P.S. As I understand, it is fully available in API for mobile apps. Is it ok idea to use it for our situation, if there is no other solution?

推荐答案

使用离线转换记录用户离开您的网站后发生的事件。在技术上记录这些转化非常简单。设置所有内容需要一些努力

Use Offline Conversions to record events that happen after a user has left your website. Logging these conversions, technically, is very easy. Setting everything up takes a little effort

按照 FB文档中的设置步骤(安装步骤1-5),它们是:

Follow setup steps in the FB docs (Setup steps 1-5) which are:


  • 设置Facebook业务经理帐户

  • 将新应用添加到业务经理帐户

  • 创建广告帐户,如果您没有一个

  • 为广告帐户创建系统用户

  • Setup facebook Business Manager account
  • Add a new app to Business Manager account
  • Create an Ad account, if you don't already have one
  • Create a System User for the ad account

设置,请按照同一页面上的上传事件数据步骤,步骤1-3创建脱机事件集并将其与广告相关联。可以通过以下示例中的链接在Graph API Explorer中执行这些操作。这些可以通过编程方式完成,但是不能从一个广告系列的服务器进行事件调用。

After the setup, follow Upload Event Data steps on the same page, steps 1-3 to create an offline event set and associate it with your ad. These can be carried out in the Graph API Explorer by following the links in the examples. These can be done programmatically, but is out of the scope of making the event calls from the server for one campaign.

创建事件集后,您可以上传 CompleteRegistration 事件!

Once you have created the event set, then you can upload your CompleteRegistration events!

您将需要对FB进行多表单数据请求,数据键将是转换事件的数组。如@Cbroe所述,在发送到FB之前,您必须将匹配键(可用于您的用户的数据与FB用户匹配)进行哈希。您能够提供的匹配键越多,匹配用户的机会越大。所以如果你可以同时收到他们的电子邮件和电话,那么你更有可能与你的用户相匹配。

You will need to make a multipart form data request to FB, the data key will be an array of your conversion events. As @Cbroe mentioned, you must hash your match keys (the data you have available about your user to match them with a FB user) before sending to FB. The more match keys you are able to provide, the better chance at matching your user. So if you can get their email and phone at the same time, you're much more likely to match your user.

以下是使用node.js调用FB的示例:

var request = require('request')

// The access token you generated for your system user 
var access_token = 'your_access_token'

// The ID of the conversion set you created 
var conversionId = 'your_conversion_set_id'

var options = {
    url: 'https://graph.facebook.com/v2.9/' + conversionId + '/events',
    formData: {
        access_token: access_token,
        upload_tag: 'registrations', //optional 
        data: [{
            match_keys: {
                "phone": ["<HASH>", "<HASH>"]
            },    
            currency: "USD",
            event_name: "CompleteRegistration",
            event_time: 1456870902,
            custom_data: { // optional 
                event_source: "manager approved"
            },
        }]
    }
}

request(options, function(err, result) {
    // error handle and check for success
})

离线转换文件

这篇关于从服务器调用Facebook像素事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆