{"id":20281718,"url":"https://github.com/luke-hawk/nativescript-fb-analytics","last_synced_at":"2025-03-04T03:22:55.313Z","repository":{"id":42669316,"uuid":"277776924","full_name":"luke-hawk/nativescript-fb-analytics","owner":"luke-hawk","description":"Lightweight NativeScript plugin to add Facebook Analytics to iOS and Android apps. ","archived":false,"fork":false,"pushed_at":"2023-01-14T01:01:42.000Z","size":2115,"stargazers_count":1,"open_issues_count":24,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-23T20:41:24.739Z","etag":null,"topics":["facebook-analytics","nativescript","nativescript-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/luke-hawk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-07T09:42:04.000Z","updated_at":"2021-05-04T09:59:51.000Z","dependencies_parsed_at":"2023-02-09T18:32:11.627Z","dependency_job_id":null,"html_url":"https://github.com/luke-hawk/nativescript-fb-analytics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-hawk%2Fnativescript-fb-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-hawk%2Fnativescript-fb-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-hawk%2Fnativescript-fb-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luke-hawk%2Fnativescript-fb-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luke-hawk","download_url":"https://codeload.github.com/luke-hawk/nativescript-fb-analytics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241774342,"owners_count":20018249,"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":["facebook-analytics","nativescript","nativescript-plugin"],"created_at":"2024-11-14T14:06:27.324Z","updated_at":"2025-03-04T03:22:55.254Z","avatar_url":"https://github.com/luke-hawk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nativescript: Facebook Analytics\nAdds *only* Facebook Analytics to your Nativescript app *not* the full Facebook SDK. \n\nThis plugin is based on [nativescript-facebook](https://github.com/NativeScript/nativescript-facebook) but only includes the Facebook Core Library which is needed for analytics. This way it **reduces the bundle size by 86%** compared to nativescript-facebook which includes the full Facebook SDK. If you want to learn more you may read this [blog post](https://developers.facebook.com/blog/post/2017/09/26/android-sdk-optimization/).\n\n## Installation\n```\ntns plugin add nativescript-fb-analytics\n```\n\n## Configuration\nThe following configuration is needed in order to get started with Facebook Analytics. In order to obtain a Facebook App-ID please refer to the official [documentation](https://developers.facebook.com/docs/apps/).\n\nInitialize the plugin before calling `app.run`:\n```js\n/* your-project/app/app.ts */\nimport * as app from \"tns-core-modules/application\";\nimport * as fbAnalytics from 'nativescript-fb-analytics';\n\napp.on(app.launchEvent, function (args) {\n    fbAnalytics.initAnalytics();\n});\n```\n\nAdditional configs needed for **Android**:\n```xml\n\u003c!--your-project/app/App_Resources/Android/src/main/res/values/strings.xml--\u003e\n\u003cstring name=\"facebook_app_id\"\u003eYOUR_APP_ID\u003c/string\u003e\n\n\n\u003c!--your-project/app/App_Resources/Android/src/main/res/AndroidManifest.xml--\u003e\n\u003capplication\n\tandroid:name=\"com.tns.NativeScriptApplication\"\n\tandroid:allowBackup=\"true\"\n\tandroid:icon=\"@drawable/icon\"\n\tandroid:label=\"@string/app_name\"\n\tandroid:theme=\"@style/AppTheme\"\u003e\n    \n    \u003cmeta-data android:name=\"com.facebook.sdk.ApplicationId\" android:value=\"@string/facebook_app_id\"/\u003e\n\t...\n\u003c/application\u003e\n```\n\nAdditional configs needed for **iOS**:\n```xml\n\u003c!--your-project/app/App_Resources/iOS/Info.plist--\u003e\n\u003ckey\u003eCFBundleURLTypes\u003c/key\u003e\n\u003carray\u003e\n  \u003cdict\u003e\n    \u003ckey\u003eCFBundleURLSchemes\u003c/key\u003e\n      \u003carray\u003e\n        \u003cstring\u003efbYOUR_APP_ID\u003c/string\u003e\n      \u003c/array\u003e\n  \u003c/dict\u003e\n\u003c/array\u003e\n\u003ckey\u003eFacebookAppID\u003c/key\u003e\n\u003cstring\u003eYOUR_APP_ID\u003c/string\u003e\n\u003ckey\u003eFacebookDisplayName\u003c/key\u003e\n\u003cstring\u003eYOUR_APP_NAME\u003c/string\u003e\n```\n\n## Usage\n\nYou can log events from anywhere you want by importing\n```js\nimport * as fbAnalytics from 'nativescript-fb-analytics';\n```\n\nand calling\n```js\nfbAnalytics.logEvent('Lead');\n```\n\nYou may also add parameters to your event logging:\n```js\nconst value = 5;\nconst parameters = [{\n    key: 'value',\n    value: value.toString(),\n}];\n\nfbAnalytics.logEvent(FundsAdded, parameters);\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluke-hawk%2Fnativescript-fb-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluke-hawk%2Fnativescript-fb-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluke-hawk%2Fnativescript-fb-analytics/lists"}