{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Karte Export Integration","description":"Export Karte job results to Google Cloud Storage using Treasure AI, covering prerequisites, GCP credentials setup, and connector configuration steps.","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]},"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":"karte-export-integration","__idx":0},"children":["Karte Export Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/int/karte-import-integration"},"children":["Learn more about KARTE Import Integration"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use the Karte connector to write job results from queries run in Treasure Data to your Google Cloud Storage."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"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":["Toolbelt"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A Google Cloud Platform account"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"getting-google-cloud-platform-credentials","__idx":2},"children":["Getting Google Cloud Platform Credentials"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before creating the connector, you need to gather the following information: your ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Project ID"]},", and ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["JSON Credential"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"json-credential","__idx":3},"children":["JSON Credential"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The integration with Google Cloud Storage is based on server-to-server API authentication. Go to your ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Google Developer Console"]}," and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Credentials"]}," under ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["APIs & auth"]}," at the left menu. Then, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Service account"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191002-134701.439a883f70e8d8d23edfb7dd8443b07cbf84c337e1e83b8fc34d613648729db6.45d33724.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select the ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["JSON"]}," based key type, which is Google’s recommended configuration. The key is automatically downloaded by the browser."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191002-135027.40548c465aab9c1206e754feddfea9ce75b35a6f1758bbc448c6058fca0f710d.45d33724.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Service Account owner, who generated JSON Credentials, must have Write permission for destination bucket."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"specifying-output-in-your-karte-connector","__idx":4},"children":["Specifying Output in Your KARTE Connector"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"using-the-treasure-console","__idx":5},"children":["Using the Treasure Console"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-the-destination-bucket-in-google-cloud-storage","__idx":6},"children":["Create the destination Bucket in Google Cloud Storage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create your ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["bucket"]}," from your Google Cloud Storage console."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"write-the-query","__idx":7},"children":["Write the query"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Go to the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://console.treasuredata.com/app/queries/editor"},"children":["Treasure Console query editor page"]}," and compile your query."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"specify-the-result-export-target","__idx":8},"children":["Specify the Result Export target"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the same window, select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create New Connection"]}," in the ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Result Export."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191002-134829.388713a639208dedf7274c5ce4a5635d96a085dd5638e16ad520b5441ecd6da2.45d33724.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the dialog opens, search for and select your connection type: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["KARTE"]},". Provide a name for your ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["KARTE"]}," connection. Complete the information, including your JSON Credential, Bucket name, and Path:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191002-134857.656a9f0de46cfb1fd35ed35b84c57cdb29c512644f868b21f9d063d1ebca8c9f.45d33724.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191002-134934.06e85952c6070679f8d059ac8fe564d9ebe46f729e3420d08d3abbc1efe88dda.45d33724.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"execute-the-query","__idx":9},"children":["Execute the query"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Finally, either save the query with a name or just run the query. After the successful completion of the query, the results are automatically sent to the specified Google Cloud Storage destination."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191002-134949.40e5f9cff9bab28ade6ce38bc95fec50f470b84b0c1c75dae446b32e80489edd.45d33724.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"activate-a-segment-in-audience-studio","__idx":10},"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":"Heading","attributes":{"level":2,"id":"use-the-cli","__idx":11},"children":["Use the CLI"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can set a scheduled query to send job results to Google Cloud Storage using KARTE."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Designate your json_key and escape the newline with backslash."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td sched:create scheduled_karte \"10 6 * * *\" \\\n-d dataconnector_db \"SELECT id,account,purchase,comment,time FROM data_connectors\" \\\n-r '{\"type\":\"karte\",\"bucket\":\"samplebucket\",\"path_prefix\":\"/output/test.csv\",\"format\":\"csv\",\"compression\":\"\",\"header_line\":false,\"delimiter\":\",\",\"null_string\":\"\",\"newline\":\"CRLF\",  \"json_keyfile\":\"{\\\"private_key_id\\\": \\\"ABCDEFGHIJ\\\", \\\"private_key\\\": \\\"-----BEGIN PRIVATE KEY-----\\\\nABCDEFGHIJ\\\\ABCDEFGHIJ\\\\n-----END PRIVATE KEY-----\\\\n\\\", \\\"client_email\\\": \\\"ABCDEFGHIJ@developer.gserviceaccount.com\\\", \\\"client_id\\\": \\\"ABCDEFGHIJ.apps.googleusercontent.com\\\", \\\"type\\\": \\\"service_account\\\"}\"}'\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"optional-configure-export-results-in-workflow","__idx":12},"children":["(Optional) Configure Export Results in Workflow"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Within Treasure Workflow, you can specify the use of this data connector to output data."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"timezone: UTC\n\n_export:\n  td:\n    database: sample_datasets\n\n+td-result-into-target:\n  td>: queries/sample.sql\n  result_connection: karte_integration\n  result_settings:\n    bucket: your_bucket\n    path_prefix: dir/example.csv.gz\n    format: csv\n    compression: gz\n    newline: CR\n    ....\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more information on using data connectors in Treasure Workflow to export data, review ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/workflows/exporting-data-with-parameters"},"children":["Exporting Data with Parameters"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"karte-connector-parameters","__idx":13},"children":["KARTE Connector Parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use the following parameters when configuring the KARTE connector."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"bucket"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["bucket"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"bucket name"},"children":["bucket name"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["path_prefix"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["file path"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["format"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\"csv\" or \"tsv\""]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["compression"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\"\" or \"gz\", \"encryption_pgp\""]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["public key"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The public key is used to encrypt the file before being uploaded"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Key Identifier"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specifies the Key ID of the encryption subkey used to secure the file.  The master key is excluded from the encryption process."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amor"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether to use ASCII armor or not"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Compression Type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["- Defines the compression algorithm used to compress the file, which will be compressed before encryption for uploading to the SFTP server. - ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note: Please ensure that you compress your file before encrypting and uploading. When you decrypt it, the file will return to a compressed format such as .gz or .bz2."]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["header_line"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["true or false"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["delimiter"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\",\" or \"\\t\" or \""]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["null_string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\"\" or \"\\N\""]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["newline"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\"CRLF\" or \"CR\" or \"LF\""]}]}]}]}]}]},"headings":[{"value":"Karte Export Integration","id":"karte-export-integration","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":1},{"value":"Getting Google Cloud Platform Credentials","id":"getting-google-cloud-platform-credentials","depth":1},{"value":"JSON Credential","id":"json-credential","depth":2},{"value":"Specifying Output in Your KARTE Connector","id":"specifying-output-in-your-karte-connector","depth":1},{"value":"Using the Treasure Console","id":"using-the-treasure-console","depth":2},{"value":"Create the destination Bucket in Google Cloud Storage","id":"create-the-destination-bucket-in-google-cloud-storage","depth":3},{"value":"Write the query","id":"write-the-query","depth":3},{"value":"Specify the Result Export target","id":"specify-the-result-export-target","depth":3},{"value":"Execute the query","id":"execute-the-query","depth":3},{"value":"Activate a Segment in Audience Studio","id":"activate-a-segment-in-audience-studio","depth":2},{"value":"Use the CLI","id":"use-the-cli","depth":2},{"value":"(Optional) Configure Export Results in Workflow","id":"optional-configure-export-results-in-workflow","depth":2},{"value":"KARTE Connector Parameters","id":"karte-connector-parameters","depth":2}],"frontmatter":{"seo":{"title":"Karte Export Integration","description":"Export Karte job results to Google Cloud Storage using Treasure AI, covering prerequisites, GCP credentials setup, and connector configuration steps."}},"lastModified":"2026-06-17T07:22:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/karte-export-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}