Can't believe the AppInvites SDK from Google uses hard-coded custom dimension index without an API to change it.
The awkward truth is that the index of custom dimension defined in Google Anlytics can not be changed. I've already defined several custom dimensions. As a result, the collected data of AppInvites will pollute my current dimension data.
According to the document of AppInvites:
Note that this dimension must be at Index 1 in the table of Custom Demensions.