Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
offline-conversions-file-uploader
Advanced tools
Readme
FB Offline Conversions File Uploader (referred as 'OCAFU' hereinafter) is a command line tool and node.js module that helps Facebook advertisers and marketing partners upload offline transactions to the FB marketing API without building their own application for API integration.
FB Offline Conversions File Uploader requires or works with
OCAFU can be used in 3 different ways based on your environment and need:
(Note: If your organization does not support node.js, please see answer to question #2 in FAQ section below.)
Option 1: Install globally and use as command line tool
$ npm install -g offline-conversions-file-uploader
$ offline-conversions-file-uploader --accessToken YOUR_ACCESS_TOKEN... --uploadTagPrefix "Offline Sales xx/xx/xxxx"...
2017-05-15T15:52:52.265Z INFO Posting events 1 - 500 to http://graph.facebook.com/v2.9/00000000000000/events
2017-05-15T15:52:55.176Z INFO Rows 1 - 500 - Successfully uploaded 10 events.
...
Option2: Install locally and require the module to use it inside your own node app
$ npm install offline-conversions-file-uploader --save
(In your app's .js file)
const ocafu = require('offline-conversions-file-uploader');
ocafu.uploadConversionsFeed();
$ node your_app.js --accessToken YOUR_ACCESS_TOKEN... --uploadTagPrefix "Offline Sales xx/xx/xxxx"...
2017-05-15T15:52:52.265Z INFO Posting events 1 - 500 to http://graph.facebook.com/v2.9/00000000000000/events
2017-05-15T15:52:55.176Z INFO Rows 1 - 500 - Successfully uploaded 10 events.
...
Options 3. Build binary deployable to windows/linux/mac
$ git clone https://github.com/facebookincubator/offline-conversions-file-uploader
$ npm install
$ npm run build-binary (or build-binary-exe for Windows)
$./build/offline-conversions-file-uploader --accessToken YOUR_ACCESS_TOKEN... --uploadTagPrefix "Offline Sales xx/xx/xxxx"...
2017-05-15T15:52:52.265Z INFO Posting events 1 - 500 to http://graph.facebook.com/v2.9/00000000000000/events
2017-05-15T15:52:55.176Z INFO Rows 1 - 500 - Successfully uploaded 10 events.
...
This is a node.js application that will go through following steps to upload your offline conversions to FB's marketing API.
Configuration options can either be stored in a file (.yml format) or passed in as command line arguments. See following for available options:
Option | Description | default |
---|---|---|
accessToken* | Access token for API call | |
apiVer | Version of FB marketing API used | v2.9 |
columnMappingFilePath | File containing column mapping info. For more info see Column Mapping File section below. | oca_column_mapping.json in current directory |
configFilePath* | File containing offline conversions data | oca_file_uploader.conf.yml in current directory. For more info about config options see Available Configuration options section below. |
dataSetId | ID of your offline event data set | |
inputFilePath | File containing offline conversions data | |
logging | Control the logging level of program (available options: silly, debug, info, warn, error) | info |
uploadTag | Tag to identify the events uploaded. Should use unique string for each distinct file uploaded. | Offline Conversions |
uploadTagPrefix | Instead of providing uploadTag, you can also define prefix (ex: Offline Conversions), then the tool will append filename/timestamp and use it as the uploadTag. If uploadTag is set, uploadTagPrefix is ignored. ex) Offline Conversions (example_events_big_100k.csv@1493837377000) |
See example file here: here
You need to define what each column in the file is for. See an example here
and description of each key in the JSON file below:
Field | Description | Required? |
---|---|---|
header | Whether the file has header row or not | Yes |
delimiter | The delimiter for column. comma for CSV, tab for TSV, etc... | Yes |
mapping | The mapping for columns in the file. key-value pair represents "column index": "column type". For more detailed description for each column type, please see Column Types section below | Yes |
infoForNormalization | Format of your dob field to help with the normalization. See infoForNormalization section below for more info | No |
customTypeInfo | Info for the key-value pairs of custom_data fields. See customTypeInfo section below for more info. | No |
Column Type | Required? | Description |
---|---|---|
event_time | Yes | Use ISO8601 format or unixtime timestamp |
event_name | Yes | See event_time row in the data parameters table |
currency | Yes | Three-letter ISO currency for this conversion event. Required for Purchase events. |
value | Yes | Value of conversion event. Required for Purchase event. ex) 16.00 |
match_keys.xxxxx | Yes | The identifier info used to match people. xxxxx needs to be replaced with the match key type such as email, phone, etc... For list of available match key types, please see 'Key name' column in this table |
custom_data.xxxxx | No | Additional information about the conversion event. For example, send store location ID as custom_data.location_id or product category as custom_data.category |
For dob choose one of following format:
Note: '/' can be skipped (MMDDYYYY) or replaced with '-' (MM-DD-YYYY)
For each custom data column, add following JSON object to customTypeInfo.
If you added custom_data.store_num as one of the mapped columns in "mapping", you should add following:
"customTypeInfo": {
"store_num" : {
"key": "store_id", // key used in upload
"baseType": "number" // number or string
}
...
}
whois -h whois.radb.net -- '-i origin AS32934' | grep ^route
For more information, please refer to this guide which explains whitelisting for FB crawlers, but the same set of IP's are used for API servers.
FB Offline Conversions File Uploader is BSD-licensed. We also provide an additional patent grant.
FAQs
Feed File Uploader for Facebook Offline Conversions API
The npm package offline-conversions-file-uploader receives a total of 2 weekly downloads. As such, offline-conversions-file-uploader popularity was classified as not popular.
We found that offline-conversions-file-uploader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.