It depends on your moodle version. Later moodle versions have an option to change the default settings for user profile fields (until most recent 2.7/2.8 (I think) have settings built in to do this).
In Moodle 2.3 latest and probably other versions upto 2.6 you can do something similar to the below.....
Change Default user profile setting to Yes Track Forum Posts
Find this file: www.yourmoodle.com/user/editlib.php
Edit around this line number: 210
1. Find this code: $mform->setDefault('trackforums', 0);
2. Replace it with this code: $mform->setDefault('trackforums', 1);
Notice the change from default value of Zero, to One.
All user accounts created will now be set to Track Forums = Yes
Change existing users
4. If you also want to change all existing users to this setting, then run the below MySQL command on your database:
UPDATE mdl_user SET trackforums=1;
Hope that helps