How to manually set up a user-agent in the electron through universal analytics?

Viewed 26

I am using electron for development. and using universal analytics npm library for google analytics aka ga.

After a period of time, I found that most of the data were good, except the browser and system data on Google Analytics only show (no set).

Later, I realize that this part is strongly related to user-agent, but I can't found the way to manually set UA in the relevant settings. I also searched the Internet for a long time and did not find a suitable answer.

This is an optional initialization parameters in this library.

    interface VisitorOptions {
        hostname?: string | undefined;
        path?: string | undefined;
        https?: boolean | undefined;
        enableBatching?: boolean | undefined;
        batchSize?: number | undefined;
        /**
         * Tracking ID
         */
        tid?: string | undefined;
        /**
         * Client ID
         */
        cid?: string | undefined;
        /**
         * User ID
         */
        uid?: string | undefined;
        debug?: boolean | undefined;
        strictCidFormat?: boolean | undefined;
        requestOptions?: { [key: string]: any } | undefined;
        headers?: { [key: string]: string } | undefined;
    }
0 Answers
Related