{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["partial"]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Firebase Cloud Messaging Export Integration","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"firebase-cloud-messaging-export-integration","__idx":0},"children":["Firebase Cloud Messaging Export Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Firebase is a mobile- and web application development platform that helps you deliver richer app experiences. You can send direct notifications to your mobile app and website through Firebase Cloud Messaging."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Realtime Database and Cloud Firestore can stock document-structured data and synchronize the corresponding apps in milliseconds whenever a data transformation occurs. The app and its database listen to each other, providing your customers with a more reactive app experience. Using Firebase ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Cloud Functions you"]}," can write backend code to respond to events happening in the Firebase platform without having to deal with any servers."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Basic knowledge of Treasure Data, including the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["TD Toolbelt"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A Google Firebase Project."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For substitution, NULL values will be truncated to ““ (empty string). If the substitution is for a numeric column, there will be a warning and the record is skipped."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Because the messages are sent individually, we will not revert the whole sessions. The error messages are logged to the Treasure Console, but the job will continue."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Strong knowledge of the Firebase message template structure."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"use-the-treasure-console-to-create-your-connection","__idx":2},"children":["Use the Treasure Console to Create Your Connection"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-new-connection","__idx":3},"children":["Create a New Connection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you configure a data connection, you provide authentication to access the integration. In Treasure Data, you configure the authentication and then specify the source information."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open Treasure Console."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to Integrations Hub > Catalog."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Search for and select Firebase."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200519-215903.52e326f47355487197798de2bf799b978ede99fd43793a96f2bf4f3963567dfb.0991c1f0.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following dialog opens."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200519-220112.b3533425c4b5b067b33da54249c7783ede22ec31f9adcac96cf169b3a4617631.0991c1f0.png","alt":""},"children":[]}," ","4. Type or paste the credential from your ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://firebase.google.com/docs/cloud-messaging/auth-server"},"children":["Google Developer Console service account"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200608-200049.7b4d29c1032bfd3d5b58712d5bdaaa6e1fab724027656cd2a19f8f3d48307243.0991c1f0.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done."]}]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://firebase.google.com/docs/admin/setup#:~:text=To%20authenticate%20a%20service%20account,confirm%20by%20clicking%20Generate%20Key"},"children":["Firebase document"]}," to create a new service account key."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configure-export-results-in-your-data-connection","__idx":4},"children":["Configure Export Results in Your Data Connection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this step, you create or reuse a query. In the query, you configure the data connection."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configure-the-connection-by-specifying-the-parameters","__idx":5},"children":["Configure the Connection by Specifying the Parameters"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the Treasure Console."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Queries"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the query that you plan to use to export data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Export Results"]}," located at top of your query editor. The Choose Integration dialog opens. You have two options when selecting a connection to use to export the results, using an existing connection or creating a new one."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200605-093602.2443bc93d261fe564b0e947b2b2acd38be82163c057edda478c09aea5fda086d.0991c1f0.png","alt":""},"children":[]}," ","5. Use an existing connection"]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":6},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Type the connection name in the search box to filter."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select your connection"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Specify the export details."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200623-143430.add8062f0f004dba41178f8e97657c7c3123612a52ebc7b68215fbc4e3da6ebb.0991c1f0.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Project Id:"]}," project ID of your Firebase project."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Message Template:"]}," the connector replaces all substitution columns and aliases (___column_name___) in the template to the individual messages to send Firebase Message. All substitution columns and aliases exist in the export data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Fast Mode:"]}," Enable parallel run with no validations, no errors logs and no retries. Default: false"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Connection Timeout in Seconds:"]}," HTTP connect/read/write timeout in seconds. Default: 30. Min: 10. Max: 300."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Max retries"]}," (optional): Number of retries before the system gives up. Default: 7."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Initial retry time wait in milliseconds"]}," (optional): The time, in milliseconds, between the first and second attempt. Default: 500, which is equivalent to 0.5 seconds."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Max retry wait in milliseconds"]}," (optional): The time, in milliseconds, between the second and all subsequent attempts. Default: 300000, which is equivalent to 5 minutes."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following is a sample template configuration:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n\t\"message\": {\n\t\t\"notification\": {\n\t\t\t\"title\": \"___title___\",\n\t\t\t\"body\": \"___body___\"\n\t\t},\n\t\t\"topic\": \"weather\"\n\t}\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20200623-144229.ff804776278f933981cc42f8a32c5537339dba469ea75ad3e62ef36ed0126ad7.0991c1f0.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-of-a-query-to-populate-firebase","__idx":6},"children":["Example of a Query to Populate Firebase"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["From Treasure Data, run the following query and export results to a connection for Firebase:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"SQL","header":{"controls":{"copy":{}}},"source":"Select 'test_body' as body, 'test_title' as title\n","lang":"SQL"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"optionally-use-scheduled-jobs-for-export","__idx":7},"children":["Optionally Use Scheduled Jobs for Export"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use Scheduled Jobs with Result Export, to periodically write the output result to a target destination that you specify."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"activate-a-segment-in-audience-studio","__idx":8},"children":["Activate a Segment in Audience Studio"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can also send segment data to the target platform by creating an activation in the Audience Studio."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Audience Studio"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select a parent segment."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the target segment, right-mouse click, and then select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Activation."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Details"]}," panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Customize the activation output in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Output Mapping"]}," panel."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/ouput.b2c7f1d909c4f98ed10f5300df858a4b19f71a3b0834df952f5fb24018a5ea78.8ebdf569.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Attribute Columns",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Export All Columns"]}," to export all columns without making any changes."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["+ Add Columns"]}," to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["+ Add Columns"]},"to add new columns for your activation output."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["String Builder",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["+ Add string"]}," to create strings for export. Select from the following values:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["String: Choose any value; use text to create a custom value."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Timestamp: The date and time of the export."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Segment Id: The segment ID number."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Segment Name: The segment name."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Audience Id: The parent segment number."]}]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":6},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schedule"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/snippet-output-connector-on-audience-studio-2024-08-28.a99525173709da1eb537f839019fa7876ffae95045154c8f2941b030022f792c.8ebdf569.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the values to define your schedule and optionally include email notifications."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":7},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create"]},"."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you need to create an activation for a batch journey, review ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/journey-orchestration/batch/creating-a-batch-journey-activation"},"children":["Creating a Batch Journey Activation"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["i"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"optionally-configure-export-results-in-workflow","__idx":9},"children":["Optionally Configure Export Results in Workflow"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Within Treasure Workflow, you can specify the use of this data connector to export data."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"timezone: UTC\n\n_export:\n  td:\n database: sample_datasets\n\n+td-result-into-firebase:\n  td>: queries/sample.sql\n  result_connection: your_connections_name\n  result_settings:\n    service_account_json: '{\"type\":\"service_account\",\"project_id\":\"project_id\",\"private_key_id\":\"####\"}'\n    project_id: project_id\n    message_template: {\"message\":{\"notification\":{\"title\":\"___title___\",\"body\":\"___body___\"},\"topic\":\"weather\"}}\n    fast_mode: true\n    connection_timeout_seconds: 30\n    retry_count: 7\n    retry_initial_wait_millis: 500\n    max_retry_wait_millis: 300000\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Optionally, read more information on using data connectors in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/int/treasure-data-data-exchange-export-integration"},"children":["workflow to export data"]},"."]}]},"headings":[{"value":"Firebase Cloud Messaging Export Integration","id":"firebase-cloud-messaging-export-integration","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Use the Treasure Console to Create Your Connection","id":"use-the-treasure-console-to-create-your-connection","depth":2},{"value":"Create a New Connection","id":"create-a-new-connection","depth":3},{"value":"Configure Export Results in Your Data Connection","id":"configure-export-results-in-your-data-connection","depth":2},{"value":"Configure the Connection by Specifying the Parameters","id":"configure-the-connection-by-specifying-the-parameters","depth":3},{"value":"Example of a Query to Populate Firebase","id":"example-of-a-query-to-populate-firebase","depth":3},{"value":"Optionally Use Scheduled Jobs for Export","id":"optionally-use-scheduled-jobs-for-export","depth":3},{"value":"Activate a Segment in Audience Studio","id":"activate-a-segment-in-audience-studio","depth":2},{"value":"Optionally Configure Export Results in Workflow","id":"optionally-configure-export-results-in-workflow","depth":2}],"frontmatter":{"seo":{"title":"Firebase Cloud Messaging Export Integration"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/firebase-cloud-messaging-export-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}