Script to take data from Salesloft CRM https://developers.salesloft.com/api.html and load into Postgres
Looking to Answer
-
Count of leads added
-
Count of emails Sent
-
Count of email replies
-
Count of leads aded to interest cadence
-
% of leads in interest cadence with touches in the last 2 weeks
-
Count of leads that have X Tag
In sudo crontab -e to run Mon-Friday at 10 UTC (Make sure root has all the python libraries installed)
0 10 * * 1-5 cd /home/matts/Documents && sudo /usr/bin/python3 /home/matts/Documents/new_people.py
3 10 * * 1-5 cd /home/matts/Documents && sudo /usr/bin/python3 /home/matts/Documents/new_emails.py
6 10 * * 1-5 cd /home/matts/Documents && sudo /usr/bin/python3 /home/matts/Documents/interest.py
9 10 * * 1-5 cd /home/matts/Documents && sudo /usr/bin/python3 /home/matts/Documents/uploads.py
12 10 * * 1-5 cd /home/matts/Documents && sudo /usr/bin/python3 /home/matts/Documents/email_upload.py
15 10 * * 1-5 cd /home/matts/Documents && sudo /usr/bin/python3 /home/matts/Documents/people_upload.py
- Check how often data is refreshed, as dropping and pulling all data can be time intesive
- This has been addressed using the updated_at column
- Using a staging table
- Done
- Use https://cloud.google.com/functions for serverless script and have csvs stored in https://cloud.google.com/storage for backup
SELECT created_at::date as date
,COUNT(*)
FROM salesloft.people
WHERE created_at >= CURRENT_DATE - 30
GROUP BY 1