There are three Google Analytics widgets included in the dashboard from start, Web analytics, E-commerce analytics and Page top list.
To use these widgets, you need to save your Google Client ID and Client Secret in Litium. Once this is done, when users log in to back office and want to setup the Google Analytics widgets, only step 9 to 11 below are required.
Create your Google Client ID and Client Secret
To use the Google Analytics widgets, you need to have a Google Analytics account connected to the web site.
To be able to log in you need to use a real domain for your site. The domain http://mydev.local will not work. For easy testing you can assign the domain http://mydev.localtest.me to the bindings in IIS. The localtest.me domain is configured so everything.localtest.me will be pointed to 127.0.0.1/localhost.
1. Create a Google ID
1.1. Go to console.developers.google.com.
1.2. Log in using the Google Analytics account.
1.3. Click Create project.

2. Project name
2.1. Enter a project name, for example "Litium dashboard widgets".
2.2. To add a product logo is optional.
2.3 Click Next.

3. Turn on required API libraries: Analytics Reporting API and Analytics API
3.1. Click on Library, in the left menu.
3.2. Find for Analytics.
3.3. Make sure both Analytics Reporting API and Analytics API are enabled.


4. Add Authorized domain:
4.1. Click on Credentials, in the left menu.
4.2. Select OAuth consent screen.
4.3. Enter your back-office domain name, for example: mydomain.com, in Authorized domains.

5. Create a new OAuth Client ID
5.1. Select Credentials in the left menu.
5.2. Select Create credentials to create a new OAuth Client ID, with Web Application as the type.

6. Enter the Authorized JavaScript Origins. Note that only www.mydomain.com should be changed to the customer domain name. If there are more than one domain add more rows. Click Create.

7. Copy keys
Select the client Id we just created, copy the Client ID and Client Secret keys.

8. Paste ID and keys
Log in to Litium back office and go to the Settings > System Settings > Settings. Paste the client ID and client secret keys into the respective fields and click Save.

9. Open the Web Analytics or E-commerce Analytics widget in edit mode by clicking the cogwheel icon in the widget. Then click Login to Google.

10. Enter your Google Analytics account credentials and log in. Click the Allow access button.

11. In the widget settings, there are three drop down boxes: Account, Property and View. After logging in to Google, these three boxes will be loaded with data from Google.
11.1. Select Account > Property
11.2. Click View to select the website we want the widget to get data from.
11.3. Click Save.

Note: If you setup widgets with google analytics 4, there are three drop down boxes: Account, Property and Calculate conversion rate per. As Google Analytics 4 has changed recently and doesn't offer a view ID.

Google Analytics 4 offers two conversion rate metrics for each conversion: session-based conversion rate for one conversion and user-based conversion rate for one conversion. Please select the type that you want to request in the reports. Read more at here
12. Select what type of ecommerce tracking that should be used in back office (Track orders with field) - optional

Note: When you choose muilple options for a Track orders with field that has GA4. We will prioritize tracking orders with it.
The Google Analytics widgets are now ready to use. When future users log in to back office and want to setup the Google Analytics widgets, only step 9 to 11 above are required.
If you set up a widget with Google Analytics 4, its analytics data will be delayed for 24 hours. Read more at here