The only way to control the "Source" listed in MailChimp's Contact table, profiles, and segmentation, is to use a key provided by using their "Registered app" option.
Setup found in account at:
- Login
- Drop-down top right
- Select "Account"
- on the "Extras" drop-down select "Registered Apps"
- Register an App button.
- Name it what you want source to be.
- Use below PHP oauth flow to get API key unique to this app and use it in your script.
- Done
If this is done the "Source" will display as the name you provide when establishing the app.
This process essentially hands you back an API key after Oauth so beyond making used of that key in your script no other code changes should be required
Link to their API docs with a bit more info:
Sample PHP app that will return the API key for your registered app: