Zapier is an online platform that helps you automate workflows by connecting your apps and services you use. Using the MoEngage <> Zapier integration, you can create custom workflow automations for more than 5,000+ apps on Zapier.
The action "Fetch Campaign Report" helps to fetch reports configured in MoEngage that can be later uploaded to any cloud storage services.
With this action, you can fetch your configured Campaign Reports from Zapier. Some ideas to get you started -
- Every day, fetch campaign report and upload it to Google Drive.
- Fetch Campaign Report, unzip it using Convert API and upload it to Amazon S3.
The action makes use of MoEngage's Campaign Report API. For this tutorial, we will pick up Use Case #1: Every day, fetch campaign report and upload it to Google Drive. On your Zapier Dashboard, and click on "+ Create Zap" on the top-left corner.
Be sure to have configured a campaign report inside MoEngage that is set to trigger everyday.
Step 1: Select Schedule by Zapier as the Trigger App
For the trigger, type "Schedule by Zapier" and select it. This will be the trigger that will start your zap.
Step 2: Setup the trigger app
- Select the event from the dropdown: "Every Day". Click continue.
- Under the "Set up trigger" step, select the time of the day from the dropdown. Click continue.
- Click on "Test Trigger" to pull in a recent datetime as sample data.
- Once you are satisfied with this data, click continue.
Step 3: Convert date time into required format
We need to pass the datetime in our APIs according to the format mentioned in the Campaign Report API which is:
YYYYMMDD. For this, add a new action app: "Formatter by Zapier".
- Select "Formatter by Zapier".
- From the event dropdown, select "Date / Time". Click continue.
- In the setup up action step, under Transform select "Format".
- Under Values >> Input, select ID from the previous step.
- Under "To Format" >> select "Custom" and type "YYYYMMDD".
- Optionally, you can choose to select timezone as per your needs. Click continue when satisfied.
- On the next step, click "Test & continue". Your output data will be shown.
Step 4: Add MoEngage as the Action app
Click on "+" to add a new step. Then, search for "MoEngage" from the apps and select it.
Step 5: Setup MoEngage Action
- From the event dropdown, select: "Fetch Campaign Report". Click continue.
- If you have followed the prerequisites, you should see your MoEngage account already listed. You can either choose that or connect a new one. Click continue once done.
- In the next step "Set up action", you will see a form for you to either fill-in or map from the previous step. Click here to know more.
- Under File Name, type in your report and then for the timestamp, chose "Output" from the "Date / Time in Formatter by Zapier" step.
- Under API secret, type in your API secret. (Navigate to MoEngage dashboard > Settings > APIs. In the General tab, under Transaction Push/Report Settings, click Click here to show APP secret! in API Secret.)
- For our setup, we have linked the following:
- Once you are satisfied with your mappings, click on "Continue".
- You will now be presented with an option to test this setup.
- Click on "Test & continue" to test this setup.
- If the API call was successful, you should see a "success" return.
Step 6: Setup Drive Action
Next, you need to add another action step. Click "+" and select "Google Drive" from the action list.
- Type "Google Drive" and select it from the list of apps.
- Under Event, choose "Upload File". Click continue.
- Connect your Google Drive Account, if not done already. Once selected, click continue to move to the next step.
- Under "Set up action", select your Google Drive.
- Select your folder where you want the Google Drive to upload the reports.
- Under File, select the File from the previous MoEngage step.
- You can leave the File Name and File Extension blank, or fill them up according to your needs. When you are satisfied with the form, click Continue.
- You will then be asked to test your trigger. Click on "Test & continue".
- If your API call is successful, you will get the following information:
You can also verify this in your Google Drive folder. You should see your newly uploaded zip file here. This confirms that your Zap was successful.
- Once you are satisfied that everything works, click on "Publish Zap" and it will run every time a new registrant is added to your Webinar.