{"id":24167289,"url":"https://github.com/edgee-cloud/meta-capi-component","last_synced_at":"2025-03-02T09:14:49.058Z","repository":{"id":270185913,"uuid":"909577840","full_name":"edgee-cloud/meta-capi-component","owner":"edgee-cloud","description":"Meta CAPI Edgee component","archived":false,"fork":false,"pushed_at":"2025-02-27T21:26:26.000Z","size":181,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T06:01:22.321Z","etag":null,"topics":["data-collection","edge","edge-computing","edgee","facebook","meta","rust","wasm","wasm-component"],"latest_commit_sha":null,"homepage":"https://www.edgee.cloud","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edgee-cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-29T06:10:13.000Z","updated_at":"2025-02-27T21:26:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"a12d3096-71fe-4104-9431-69a08f262bc7","html_url":"https://github.com/edgee-cloud/meta-capi-component","commit_stats":null,"previous_names":["edgee-cloud/meta-capi-component"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgee-cloud%2Fmeta-capi-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgee-cloud%2Fmeta-capi-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgee-cloud%2Fmeta-capi-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgee-cloud%2Fmeta-capi-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edgee-cloud","download_url":"https://codeload.github.com/edgee-cloud/meta-capi-component/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241482104,"owners_count":19969850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-collection","edge","edge-computing","edgee","facebook","meta","rust","wasm","wasm-component"],"created_at":"2025-01-12T21:12:58.838Z","updated_at":"2025-03-02T09:14:49.052Z","avatar_url":"https://github.com/edgee-cloud.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.edgee.cloud\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.edgee.cloud/img/component-dark.svg\"\u003e\n      \u003cimg src=\"https://cdn.edgee.cloud/img/component.svg\" height=\"100\" alt=\"Edgee\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n\n\u003ch1 align=\"center\"\u003eMeta CAPI Component for Edgee\u003c/h1\u003e\n\n[![Coverage Status](https://coveralls.io/repos/github/edgee-cloud/meta-capi-component/badge.svg)](https://coveralls.io/github/edgee-cloud/meta-capi-component)\n[![GitHub issues](https://img.shields.io/github/issues/edgee-cloud/meta-capi-component.svg)](https://github.com/edgee-cloud/meta-capi-component/issues)\n[![Edgee Component Registry](https://img.shields.io/badge/Edgee_Component_Registry-Public-green.svg)](https://www.edgee.cloud/edgee/meta-capi)\n\nThis component implements the data collection protocol between [Edgee](https://www.edgee.cloud) and [Meta CAPI](https://developers.facebook.com/docs/marketing-api/conversions-api/).\n\n## Quick Start\n\n1. Download the latest component version from our [releases page](../../releases)\n2. Place the `meta_capi.wasm` file in your server (e.g., `/var/edgee/components`)\n3. Add the following configuration to your `edgee.toml`:\n\n```toml\n[[components.data_collection]]\nid = \"meta_capi\"\nfile = \"/var/edgee/components/meta_capi.wasm\"\nsettings.meta_access_token = \"YOUR_ACCESS_TOKEN\"\nsettings.meta_pixel_id = \"YOUR_PIXEL_ID\"\nsettings.meta_test_event_code = \"TEST_EVENT_CODE\" # Optional\n```\n\n## Event Handling\n\n### Event Mapping\nThe component maps Edgee events to Meta CAPI events as follows:\n\n| Edgee event | Meta CAPI Event  | Description |\n|-------------|-----------|-------------|\n| Page   | `PageView`     | Triggered when a user views a page |\n| Track  | Name of the event | Uses the provided event name directly |\n| User   | `Lead` | Used for lead identification |\n\n### User Event Handling\nUser events in Meta CAPI serve multiple purposes:\n- Triggers an `Lead` call to Meta CAPI\n- Stores `user_id`, `anonymous_id`, and `properties` on the user's device\n- Enriches subsequent Page and Track events with user data\n- Enables proper user attribution across sessions\n\n**BE CAREFUL:**\nMeta Conversions API is designed to create a connection between an advertiser’s marketing data (such as website events) and Meta systems that optimize ad targeting, decrease cost per result and measure outcomes.\nEach event you send to Meta CAPI must have a user property (at least one of the following: `email`, `phone_number`), otherwise the event will be ignored.\n\nHere is an example of a user call:\n```javascript\nedgee.user({\n  user_id: \"123\",\n  properties: {\n    email: \"john.doe@example.com\",\n  },\n});\n```\n\n## Configuration Options\n\n### Basic Configuration\n```toml\n[[components.data_collection]]\nid = \"meta_capi\"\nfile = \"/var/edgee/components/meta_capi.wasm\"\nsettings.meta_access_token = \"YOUR_ACCESS_TOKEN\"\nsettings.meta_pixel_id = \"YOUR_PIXEL_ID\"\nsettings.meta_test_event_code = \"TEST_EVENT_CODE\" # Optional\n\n# Optional configurations\nsettings.edgee_default_consent = \"pending\" # Set default consent status\n```\n\n### Event Controls\nControl which events are forwarded to Meta CAPI:\n```toml\nsettings.edgee_page_event_enabled = true   # Enable/disable page view tracking\nsettings.edgee_track_event_enabled = true  # Enable/disable custom event tracking\nsettings.edgee_user_event_enabled = true   # Enable/disable user identification\n```\n\n### Consent Management\nBefore sending events to Meta CAPI, you can set the user consent using the Edgee SDK: \n```javascript\nedgee.consent(\"granted\");\n```\n\nOr using the Data Layer:\n```html\n\u003cscript id=\"__EDGEE_DATA_LAYER__\" type=\"application/json\"\u003e\n  {\n    \"data_collection\": {\n      \"consent\": \"granted\"\n    }\n  }\n\u003c/script\u003e\n```\n\nIf the consent is not set, the component will use the default consent status.\n**Important:** Meta CAPI requires the consent status to be set to `granted`. If not, the events will be ignored.\n\n| Consent | Events |\n|---------|--------|\n| pending | ignored |\n| denied  | ignored |\n| granted | forwarded |\n\n## Development\n\n### Building from Source\nPrerequisites:\n- [Rust](https://www.rust-lang.org/tools/install)\n- WASM target: `rustup target add wasm32-wasip2`\n- wit-deps: `cargo install wit-deps`\n\nBuild command:\n```bash\nmake wit-deps\nmake build\n```\n\n### Contributing\nInterested in contributing? Read our [contribution guidelines](./CONTRIBUTING.md)\n\n### Security\nReport security vulnerabilities to [security@edgee.cloud](mailto:security@edgee.cloud)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgee-cloud%2Fmeta-capi-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgee-cloud%2Fmeta-capi-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgee-cloud%2Fmeta-capi-component/lists"}