1. 程式人生 > >Getting Started App Events

Getting Started App Events

1. Select an App or Create a New App for Your Website

Get your Facebook App ID or create a new one.

Set Your App Advertising Details

After you create an app, go to your App Dashboard. Select the app you wish to view. In the left side navigation panel of the App Dashboard, click Settings > Basic

to view the App Details Panel with your App ID, your App Secret, and other details about your app. To set up your app for advertising set the following details:

  • Platform - Scroll to the bottom of the Settings page to add the Website Platform.
  • Privacy Policy URL - You must provide a Privacy Policy
    URL. Must be provided to take your app public.
  • Terms of Service URL - You must provide a Terms of Service URL.
See the App Development docs to add more details to your app.

To run ads and measure installs in the Ads Manager, you need to associate at least one

Ad Account with your App.

  1. In the App Dashboard click Settings > Advanced.
  2. In Authorized Add Account IDs, add your Ad Account IDs. You can get your ad account IDs from your Ads Manager.

3. Integrate the Facebook SDK in Your Website

Add the SDK by Using the Quickstart

By using the Quickstart Guide from your App Dashboard to add the Facebook SDK to your Website, the code provided will already include your App ID.

Add the SDK Manually

To add the SDK manually copy and paste the following code but be sure to replace 'your-app-id' with your App ID.

<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'your-app-id',
      xfbml      : true,
      version    : 'v2.8'
    });
    FB.AppEvents.logPageView();
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "https://connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>

4. Add App Events

There are three types of App Events: Automatically Logged Events, Standard Events, popular events that Facebook has created for you, and Custom Events, events you create that are specific to your app. For websites, we recommend triggering the page view event on all pages to ensure accurate user accounts and session durations.

Automatically Logged Events

After you integrate the Facebook SDK into your app, these events are automatically logged.

EventDetails

App Install

The first time a new user activates an app or the first time an app starts on a particular device.

App Launch

When the Facebook SDK is initialized in your app for each session.

In-App Purchase

When a purchase processed by the Apple App Store or Google Play has been completed. If you use other payments platforms, you will need to add purchase event code manually.

Because these events are already in the Facebook SDK there is no need to add these events to your code.

Standard Events

You can add standard events, see the Event Names and Event Parameters below, to your app. Use the Code Generator to get the code for these events.

To Generate Code for a Standard Event

  1. Choose the Standard Event tab.
  2. In Event Name, choose a standard event.
  3. Choose Get Code.
  4. In the window, select a language to see the code to copy and paste into your app.

Standard Event Names

AppEventsConstants Value valueToSum Parameters

Achieved Level: EVENT_NAME_ACHIEVED_LEVEL

LEVEL

App Launched: EVENT_NAME_ACTIVATED_APP

Clicked on an Ad:
EVENT_NAME_AD_CLICK

AD_TYPE

Shown an Ad:
EVENT_NAME_AD_IMPRESSION

AD_TYPE

Added Payment Info: EVENT_NAME_ADDED_PAYMENT_INFO

SUCCESS

Added to Cart: EVENT_NAME_ADDED_TO_CART

Price of item added

CONTENT_TYPE, CONTENT_ID or CONTENT, and CURRENCY

Added to Wishlist: EVENT_NAME_ADDED_TO_WISHLIST

Price of item added

CONTENT_TYPE, CONTENT_ID or CONTENT, and CURRENCY

Completed Registration: EVENT_NAME_COMPLETED_REGISTRATION

REGISTRATION_METHOD

Completed Tutorial: EVENT_NAME_COMPLETED_TUTORIAL

SUCCESS, and CONTENT_ID or CONTENT

Added Contact Information:
EVENT_NAME_CONTACT

Customized a Product:
EVENT_NAME_CUSTOMIZE_PRODUCT

Donated:
EVENT_NAME_DONATE

Search for a Location:
EVENT_NAME_FIND_LOCATION

Initiated Checkout: EVENT_NAME_INITIATED_CHECKOUT

Total price of items in cart

CONTENT_TYPE, CONTENT_ID or CONTENT,NUM_ITEMS, PAYMENT_INFO_AVAILABLE, and CURRENCY

Purchased: EVENT_NAME_PURCHASED

Price of Purchase

NUM_ITEMS, CONTENT_TYPE, CONTENT_ID or CONTENT, and CURRENCY

Rated:
EVENT_NAME_RATED

Rating given

CONTENT_TYPE , CONTENT_ID or CONTENT, and MAX_RATING_VALUE

Scheduled:
EVENT_NAME_SCHEDULE

Searched: EVENT_NAME_SEARCHED

CONTENT_TYPE, SEARCH_STRING and SUCCESS

Spent Credits: EVENT_NAME_SPENT_CREDITS

Total value of credits spent

CONTENT_TYPE, and CONTENT_ID or CONTENT

Started a Trial:
EVENT_NAME_START_TRIAL

Price of Subscription

ORDER_ID and CURRENCY

Submitted an Application:
EVENT_NAME_SUBMIT_APPLICATION

Subscribed:
EVENT_NAME_SUBSCRIBE

Price of Subscription

ORDER_ID and CURRENCY

Unlocked Achievement: EVENT_NAME_UNLOCKED_ACHIEVEMENT

DESCRIPTION

Viewed Content:
EVENT_NAME_VIEWED_CONTENT

Price of item viewed (if applicable)

CONTENT_TYPE, CONTENT_ID or CONTENT, and CURRENCY

Event Parameters

The table below are typically useful parameters for inclusion with the events shown above or with your own custom events. Future enhancements to our insights product will use the recommended parameters, but note that you can provide your own parameters as well.

These parameters are intended to provide guidance on typically useful logging patterns, and may have a more readable form in reporting and other UI. Your app should log the set of parameters that it's interested in seeing breakdowns on in insights. The recommended description for these are guidance only - you can use these parameters for whatever makes sense for your app.

If you need to remove obsolete parameters - you can deactivate parameters by following the instructions in our help center.

The parameters are passed via a Bundle where the key holds the parameter name and the value either a String or an int, as shown below. If you provide another type of value that is not compliant such as a boolean, the SDK logs a warning to LogginBehavior.APP_EVENT.

AppEventConstants::EVENT_PARAM_* Possible Values Description

Ad Type:

EVENT_PARAM_AD_TYPE

string

Type of ad: banner, interstitial, rewarded_video, native

Content:

EVENT_PARAM_CONTENT

string

A list of JSON object that contains the International Article Number (EAN) when applicable, or other product or content identifier(s) as well as additional information about the products. id, quantity, and item_price are the available fields. e.g. "[{\"id\": \"1234\", \"quantity\": 2, \"item_price\": 5.99}, {\"id\": \"5678\", \"quantity\": 1, \"item_price\": 9.99}]"

Content ID:

EVENT_PARAM_CONTENT_ID

string

International Article Number (EAN) when applicable, or other product or content identifier

Content Type:

EVENT_PARAM_CONTENT_TYPE

string

'product' or 'product_group'

Currency:

EVENT_PARAM_CURRENCY

string

ISO 4217 code, e.g., "EUR", "USD", "JPY"

Description:

EVENT_PARAM_DESCRIPTION

string

A string description

Level:

EVENT_PARAM_LEVEL

string

Level of a game

Max. Rating Value:

EVENT_PARAM_MAX_RATING_VALUE

int

Upper bounds of a rating scale, for example 5 on a 5 star scale

Number of Items:

EVENT_PARAM_NUM_ITEMS

int

Number of items

Order ID:

EVENT_PARAM_ORDER_ID

string

The unique ID for all events within a subscription

Payment Info Available:

EVENT_PARAM_PAYMENT_INFO_AVAILABLE

1 or 0

1 for yes, 0 for no

Registration Method:

EVENT_PARAM_REGISTRATION_METHOD

string

Facebook, Email, Twitter, etc.

Search String:

EVENT_PARAM_SEARCH_STRING

string

The text string that was searched for

Success:

EVENT_PARAM_SUCCESS

1 or 0

1 for yes, 0 for no

Custom App Events

Facebook Analytics supports up to 1,000 unique events for your app or website, so you can also create your own custom events. Use the Code Generator to generate code for these events.

Do not use event as the name of a parameter. Custom parameters with the name event will not be logged. Use another name or add a prefix or suffix to the name, such as my_custom_event.

To Generate Code for a Standard Event

  1. Choose the Custom Event tab.
  2. In Event Name, choose a standard event.
  3. Choose Get Code.
  4. In the window, select a language to see the code to copy and paste into your app.

To log a custom event, just pass the name of the event as a string:

function onButtonClick() {
  // Add this to a button's onclick handler
  FB.AppEvents.logEvent("my_app_event");
}

5. Test Your Events

In Facebook Analytics Dashboard

You can review the most recent events logged by your app or website. To verify these events, visit Facebook Analytics. Then choose your app and go to Activity > Event Debugging.

You should see your app launch (if you're setting up an app) or the page view event (if you're setting up a website) as well as the custom event for the button click. If not, click the refresh button to load the latest events.

Once you've verified that your events are being logged correctly, then you can to help you measure conversion for any sequence of events you choose.

In the App Ads Helper Tool

The App Ads Helper allows you to test the app events in your app to ensure that your app is sending events to Facebook.

b. In Select an App, choose your app and choose Submit.

c. Go to the bottom and choose Test App Events.

d. Start your app and send an event. The event appears on the web page.

相關推薦

Getting Started App Events

1. Select an App or Create a New App for Your Website Get your Facebook App ID or create a new one. Set Your App Advertising Details After you

Getting Started with App Events-iOS

1. Select an App or Create a New App Please select an app or create a new one to get a Facebook App ID. Setup Your App Details for Advertising Go to your

Getting Started with Android App Development

As an open platform, Android developers have a few choices for distributing apps to users, customers, developers, and business associates. For pu

Getting Started with iOS App Development

Explore the tools, technologies, capabilities, and languages included in the iOS SDK that make app development possible. Some iOS SDK essentials

LLVM每日談之十九 LLVM的第一本系統的書&lt;Getting Started with LLVM Core Libraries&gt;

關於 日本 簡單的 lvm 作者 普通 lan 最好 裏的 作者:史寧寧(snsn1984)LLVM最終有了一本系統的書了——《Getting Started with LLVM Core Libraries》。這本書號稱是LLVM的第一本書,可是據說日本早就有兩本日文的

Apache ZooKeeper Getting Started Guide 翻譯

tail var directory storage 我們 刪除 multi 包括 initial ZooKeeper 開始向導 開始: 用zookeeper協調分布式程序 單例操作管理zookeeper存儲連接zookeeper執行zookeeper以復

Scala函數式程序設計原理 week1 Getting Started + Functions & Evaluation

lua cin margin cal brk star oci http scala函數 6職4T扒守1F39琳俸http://www.docin.com/app/user/userinfo?userid=178838116 OE泄妨繕5H93419IYhttp://wei

Getting started with Kentico

sbo short conf doc body his learn cati site https://docs.kentico.com/k10tutorial https://docs.kentico.com/k10tutorial/getting-started

[原創]Getting Started with Skywalking

-c java word nta rec compress tar mbed already Getting Started with Skywalking Pre JDK 1.8+ Skywalking(v3.2.6) (All packages can

play02-Getting started-Creating a new application

Scala play sbt https://www.playframework.com/documentation/2.6.x/NewApplication 使用Play starter project:https://playframework.com/download#starters如果你

play01-Getting started-Installing Play

Scala sbt Play https://www.playframework.com/documentation/2.6.x/HomeGetting started https://www.playframework.com/documentation/2.6.x/Installing 這個頁

Part 1 - Getting Started(1-3)

pre ews djang clas -c django request htm complex https://simpleisbetterthancomplex.com/series/2017/09/04/a-complete-beginners-guide-to-d

PCL入門/基本結構(Getting Started / Basic Structures)

#入門/基本結構 PCL 1.x中的基本資料型別是PointCloud。 PointCloud是一個包含以下資料欄位的C ++類: 寬度width (int) 在點數中指定點雲資料集的寬度。寬度有兩個含義: 它可以指定點的雲中的總數(equal with the number of

Docker Getting Started

  Docker 是什麼 Docker 是什麼上網搜一下就知道了,我只說說自己的體會。Docker 利用 Linux Kernel 提供的 cgroups, namespaces 等技術,構建類似沙盒的環境。在沙盒裡你怎麼搞破壞都沒事,從而達到了與主機環境隔離的作用。

Getting started with docker - 1.Orientation and setup

Get Started, Part 1: Orientation and setup Get Started, Part 1: Orientation and setup Docker concepts Images and cont

Getting Started with Processing 第四章總結

為什麼要使用變數: 我們使用變數的一個重要原因就是避免變成過程中的重複工作,如果你重複使用某一個數字超過了一次,就可以考慮使用一個變數來代替它,這樣你的程式會更加通用並且易於更新。 定義變數 定義變數的時候,要確定其變數名(name),資料型別(data type) 和變數值 value.在 Proce

Getting Started with Processing 第五章的easing問題

分析 使用 easing easing 的感官目的是為了 draw 的時候,畫的圖形不是即時 mouseX 的值,而是稍有落後一點。從演算法分析,就是讓所畫圖形的 x 座標 落後於 mouseX 的值,並且朝 mouseX 的方向進行運動。程式如下: float x; float easing =

Sequelize-nodejs-1-getting started

Sequelize is a promise-based ORM for Node.js v4 and up. It supports the dialects PostgreSQL, MySQL, SQLite and MSSQL and features solid transaction support

Getting Started with Processing 第五章的easing問題(2)

上一個 第五章 RoCE mouse process 一次 成了 參數 二維 程序代碼清單如下: float x; float y; float px; float py; float easing = 0.05; void setup(){ size(480,120)

Getting Started with Processing 第五章的總結

Getting Started with Processing 第五章:響應 一次與永久 setup()函式 Processing 中,setup()函式只執行一次,用於設定一些初始的值,比如畫布的大小,還有填充和線條粗細,顏色的程式碼。第一行總是size(),接下啦是其他宣告。 draw()函式