Overview
Secure File Transfer Protocol (SFTP) is a network protocol for securely accessing, transferring, and managing large files and sensitive data over any reliable data stream. Designed by the Internet Engineering Task Force as an extension of Secure Shell (SSH) version 2.0, SFTP provides secure file transfer capabilities.
How Does MoEngage Work with SFTP?
MoEngage allows customers to automatically import users and events from their SFTP servers and export events from MoEngage through flat files.
Integration with SFTP servers will allow MoEngage to:
- Share periodic exports of campaign interaction events in JSON format.
- Support for both username-password and username-SSH key method.
- Support for VPC/private endpoints of the hosts.
You can export all user events and campaign events that are received or generated by MoEngage to your SFTP servers. You can further analyze the exported data to glean insights into user behavior, preferences, and what have you.
Integration
library_add_check |
Prerequisites Ensure you have connection access to your SFTP server. |
Set Up a New SFTP Connection
To import data from or export data to SFTP servers, you must first connect MoEngage to your SFTP server. To create a new SFTP Connection:
- On your MoEngage Dashboard, go to the App Marketplace.
- Search for "SFTP".
- Go to the Integrate tab and click + Add Connection.
- Enter your SFTP server details:
Field Description Example Connection Name Give this connection an identifiable name. SFTP Connection Host Enter the host name to connect to.
128.0.0.0 or ftp.moengage.com Port Optionally, select which port to connect to on your SFTP server. Valid ports range from 1 to 65535. Default port is 22.
Username Enter the username for the SFTP connection.
You can enter an existing user with the read and write access or create a new one for MoEngage.
Password Provide the password of the database user you entered.
- Click Test connection to test your details and MoEngage will attempt to verify the credentials.
- Click Save connection to save the connection.
After the connection between MoEngage and your SFTP server is successful, you can use it to configure various imports and exports in MoEngage.
Set Up Imports from SFTP
MoEngage allows customers to import users and events through files stored inside your SFTP folders. For more information, refer to SFTP Imports.
Set Up Exports to SFTP
info |
Information The export option is enabled only when you set up at least one connection. |
To enable SFTP Exports on the MoEngage App Marketplace:
- On your MoEngage Dashboard, go to the App Marketplace.
- Search for "SFTP".
- Go to the Integrate tab and click + Add export.
- Enter the export details:
Field Description Example Export name Give the export a name.
SFTP Export SFTP connection Select an existing SFTP connection from the list of connections you created in Set Up a New SFTP Connection. SFTP Connection Folder path The folder path to which we will dump the files.
You can see the preview of file path.
User properties Select user properties (user properties and device properties) you want to export with your events.
User attributes (such as user attributes, device attributes, and custom attributes) are available in Data Management for that Database/App.
Select events Select the events you want to export to your SFTP server. The available options are:
- All events
- Select events manually
You can choose to export "All events" (existing and new events coming into MoEngage in the future) or cherry-pick events manually and export only those events.
Select events (drop-down) This drop-down list is visible only if you select Select events manually under Select events.
The events on this drop-down list are auto-populated with all the events in Data Management for that Workspace.
Frequency Select how often you want to export these events. We offer three frequencies:
- Every 15 mins: We will dump files at 15-minute intervals.
- Daily: We will dump files at the end of each day, 00:00 UTC.
- Weekly: We will dump files on every Monday, 00:00 UTC.
A preview of next dump is displayed in case of Daily and Weekly.
It is not recommended to frequently change your export frequency because this might result in data loss or data duplication.
- Click Save export. Your export will be saved and when the Export status toggle is turned on, MoEngage will start exporting files to the specified folder path on your SFTP server based on the selected export frequency.
Events and Attributes
With the MoEngage and SFTP integration, you can export all events coming into MoEngage to your SFTP servers. By default, MoEngage tracks some standard events and user properties through its SDKs. You can read about our standard events and attributes here. You can also export any custom user-defined event you tracked in MoEngage.
Data Export Format
Information | Description |
File Format | JSON |
Compression Type | GZip |
Export Frequency | Every 15 mins, Daily, or Weekly |
Sample Folder Path |
sftp://<host_name>/[<folder_path>/]<connection_name>/export_date={DD-MM-YYYY}/{filename=event_export}_<epoch_timestamp>[_<file_number>].json.gz
Here:
|
You can download a sample file from here. This is a GZIPPED file and you must extract it before you can view the files.
For the full list of events and attributes exported, refer to the Data Exports Glossary.