{"id":18426193,"url":"https://github.com/clevertap/clevertap-segment-integration-docs","last_synced_at":"2026-01-22T05:03:18.059Z","repository":{"id":145639472,"uuid":"55815780","full_name":"CleverTap/clevertap-segment-integration-docs","owner":"CleverTap","description":"CleverTap Segment integration docs","archived":false,"fork":false,"pushed_at":"2021-11-11T08:07:20.000Z","size":4,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-13T20:02:25.115Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CleverTap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-04-08T23:31:05.000Z","updated_at":"2022-06-23T09:22:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"4906cae1-ef52-4487-9787-0c70b843f16b","html_url":"https://github.com/CleverTap/clevertap-segment-integration-docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CleverTap/clevertap-segment-integration-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fclevertap-segment-integration-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fclevertap-segment-integration-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fclevertap-segment-integration-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fclevertap-segment-integration-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleverTap","download_url":"https://codeload.github.com/CleverTap/clevertap-segment-integration-docs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleverTap%2Fclevertap-segment-integration-docs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28655036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-06T05:07:09.983Z","updated_at":"2026-01-22T05:03:18.040Z","avatar_url":"https://github.com/CleverTap.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## Getting Started\n\nOnce the Segment library is integrated, toggle CleverTap on in your Segment integrations, and add your CleverTap Account ID and CleverTap Account Token which you can find in the CleverTap Dashboard under Settings.\n\nYou can integrate CleverTap via a server-side or mobile destination (iOS or Andriod). If you are interested in using CleverTap’s push notifications or in-app notifications products, you should use the mobile destinations.\n\nAll server-side destination requests require either a Segment Anonymous ID or a userId in the payload.\n\nCleverTap supports the `identify`, `track`, `page` (server-side only), and `screen` (iOS and server-side only) methods.\n\n\n## Identify\n\nWhen you identify a user, we'll pass that user's information to CleverTap with userId as CleverTap's Identity value. A number of Segment's special traits map to CleverTap's standard user profile fields.  You’ll pass the key on the left into Segment and we will transform it to the key on the right before sending to CleverTap.\n\n- `name` maps to `Name`\n- `birthday` maps to `DOB`\n- `avatar` maps to `Photo`\n- `gender` maps to `Gender`\n- `phone` maps to `Phone`\n- `email` maps to `Email`\n\nAll other traits will be sent to CleverTap as custom attributes.\n\n## Track\n\nWhen you `track` an event, we will send that event to CleverTap as a custom event.  Note that CleverTap does not support arrays or nested objects for custom track event properties.\n\n### Order Completed\n\nWhen you `track` an event via the server-side destination with the name `Order Completed` using the [e-commerce tracking API](https://segment.com/docs/spec/ecommerce/v2/), we will map that event to CleverTap's [Charged](https://support.clevertap.com/docs/working-with-events.html#recording-customer-purchases) event.\n\n## Page\n\nWhen you send a `page` event via the server-side destination, we will send that event to CleverTap as a Web Page Viewed event.\n\n## Screen\n\nWhen you send a `screen` event via the server-side destination or the iOS bundled SDK, we will send that event to CleverTap as an App Screen Viewed event.\n\n## Android\n\n### Integrating\n\n1. Add the CleverTap Segment Integration dependency to your app build.gradle:\n\n    `compile 'com.clevertap.android:clevertap-segment-android:+'`\n\n    **Note**: Our group Id is `com.clevertap.android`, not `com.segment.analytics.android.integrations`.\n\n2. Next, declare CleverTap's integration in your Analytics instance:\n\n   ``` \n   Analytics analytics = new Analytics.Builder(context, \"YOUR_WRITE_KEY_HERE\")  \n     .use(CleverTapIntegration.FACTORY)  \n     ...  \n     .build();  \n   ```\n\n### Integrating Push     \n\n1. In your AndroidManifest.xml, register the following CleverTap services.  \n\n    ```\n    \u003cservice\n        android:name=\"com.clevertap.android.sdk.FcmTokenListenerService\"\u003e\n        \u003cintent-filter\u003e\n            \u003caction android:name=\"com.google.firebase.INSTANCE_ID_EVENT\"/\u003e\n        \u003c/intent-filter\u003e\n    \u003c/service\u003e\n    \n    \u003cservice\n        android:name=\"com.clevertap.android.sdk.FcmMessageListenerService\"\u003e\n        \u003cintent-filter\u003e\n            \u003caction android:name=\"com.google.firebase.MESSAGING_EVENT\"/\u003e\n        \u003c/intent-filter\u003e\n    \u003c/service\u003e\n    ```\n    \n2. For more in-depth information, visit our [Android push integration documentation](https://support.clevertap.com/integration/android-sdk/#push-notification-support).\n\n### In-App Notifications\n\n1. In your AndroidManifest.xml, add the CleverTap InAppNotificationActivity.\n\n    ```\n    \u003cactivity  \n            android:name=\"com.clevertap.android.sdk.InAppNotificationActivity\"  \n            android:configChanges=\"orientation|keyboardHidden\"  \n            android:theme=\"@android:style/Theme.Translucent.NoTitleBar\" /\u003e  \n    ```\n\n    No further action is required to integrate in-app notifications, which are registered for and requested by default by our CleverTap Segment integration.\n\n\n### Sample App\n\nCleverTap has created a sample Android application that integrates CleverTap via Segment. Check it out at the [Github repo](https://github.com/CleverTap/clevertap-segment-android-example).\n\n## iOS \n\n### Integrating\n\n1. Add the CleverTap Segment Pod to your Podfile:\n\n    `pod 'Segment-CleverTap'`\n\n    We recommend using the latest version on [CocoaPods](https://cocoapods.org/pods/Segment-CleverTap) since it will contain the most up to date features and bug fixes.\n\n2. Next, declare CleverTap's integration in your app delegate instance:\n\n    ```\n    SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@\"YOUR_WRITE_KEY_HERE\"];\n    [config use:[SEGCleverTapIntegrationFactory instance]];\n    [SEGAnalytics setupWithConfiguration:config];\n    ```\n\n### Integrating Push     \n\n1. Follow the directions to register for push at: [https://segment.com/docs/libraries/ios/#how-do-i-use-push-notifications-](https://segment.com/docs/libraries/ios/#how-do-i-use-push-notifications-).\n\n2. In your application's application:didReceiveRemoteNotification: method, add the following:\n\n    `[[SEGAnalytics sharedAnalytics] receivedRemoteNotification:userInfo];`\n\n3. If you integrated the application:didReceiveRemoteNotification:fetchCompletionHandler: in your app, add the following to that method:\n\n    `[[SEGAnalytics sharedAnalytics] receivedRemoteNotification:userInfo];`\n\n4. If you implemented handleActionWithIdentifier:forRemoteNotification:, add the following to that method:\n\n    `[[SEGAnalytics sharedAnalytics] handleActionWithIdentifier:identifier forRemoteNotification:userInfo];`\n\n### In-App Notifications\n\nNo further action is required to integrate in-app notifications, which are registered for and requested by default by our CleverTap Segment integration.\n\n### Sample App\n\nCleverTap has created a sample iOS application that integrates CleverTap via Segment. Check it out at the [Github repo](https://github.com/CleverTap/clevertap-segment-ios/tree/master/Example).\n\n## Server-Side Push Tokens\n\nIf you chose not to bundle the CleverTap Mobile SDK, then you will have to implement your own Push Message processors (and you won’t have access to CleverTap’s In-App feature).\n\nIf you decide to implement your own Push Message processors, then you can pass push tokens to CleverTap via the server-side destination. You can do this by sending it inside context.device.token.\n\n## Settings\n\n### CleverTapAccountID\n\nThe Account ID found in your CleverTap dashboard, used to identify your application.\n\n### CleverTapAccountToken\n\n**Mobile Only**: The Account Token  found in your CleverTap dashboard, used to identify your application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevertap%2Fclevertap-segment-integration-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclevertap%2Fclevertap-segment-integration-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevertap%2Fclevertap-segment-integration-docs/lists"}