You can write a script that runs daily on the server and connects to Twitter to measure the number of subscribers, and then uploads the number of subscribers to Google Analytics. You can also report this event to Google Analytics when you receive a new follower or when a follower tracks you.
There are several options for loading data into Google Analytics:
1. Use a library that implements the server-side ga.js script
When you use Google Analytics as described by Google, you include the script in your site. This script sends data from the visitors browser to the Google Analytics server.
This script was reverse engineered and implemented in server side libraries. Now you can send the same data from the server to the Google Analytics server. You can use PHP-GA for PHP or pyga for Python.
2. Use the Google Analytics measurement protocol
The Google Analytics Measurement Protocol is the new API for sending data to Google Analytics. You can send data by sending POST requests to the API.
source share