You can access Google Analytics reports right from the reports section of your LeadSquared account.
They are available at Reports>Reports Home>Website and Landing Pages.
A one-time set up is required to access these reports. You must complete the following configurations in both the Google Developer Console as well as the LeadSquared web application –
- Create a new project in the Google Developer Console
- Enable Google Analytics API
- Generate OAuth Client ID and whitelist ‘leadsquared.com’ in both the application and for the Client ID
- Pass the OAuth Client ID in any Google Analytics report in the LeadSquared application, then log in and accept permissions
This article takes you through the setup procedure, step by step.
Prerequisites
- Ensure that the user performing the setup has access to LeadSquared reports.
- You must have a Google account with access to Google Analytics and Google Developer Console.
Create a New Project
1. In the Google Developer Console (https://console.developers.google.com), click Select a project, and create a new project when prompted.
2. Give the project a valid name (for e.g., ‘LeadSquared Embedded Reports’) and click the Create button.
Enable Google Analytics API
1. Navigate to https://console.developers.google.com and login with the Gmail ID associated with your Google Analytics account.
2. On the left pane, click API & Services.
3. Click Enable APIs and Services.
4. You’ll be directed to the API Library page.
5. Search for and select Google Analytics API.
6. Click the Enable button.
Generate OAuth Client ID and Whitelist URL
1. Navigate to https://console.developers.google.com. On the left pane, click the Credentials tab, then click OAuth Consent Screen. Enter an application name (for e.g., ‘LeadSquared Embedded Reports App’)
2. Scroll down the page and under Authorised domains, enter ‘leadsquared.com’. Click Save.
3. Click the Credentials tab, then click Create Credentials and select OAuth Client ID.
4. Select the Application Type as Web Application. Enter a valid name for the OAuth Client ID. Under Authorized JavaScript origins enter this URL – https://r-sg.leadsquared.com then click Create.
5. The Client ID that gets generated must be used in the LeadSquared Reports to access the embedded Google Analytics report. Copy this Client ID.
Access Google Analytics Reports in LeadSquared
1. Log in to your LeadSquared account (https://login.leadsquared.com).
2. Navigate to Reports>Reports Home.
3. Scroll down the page and click Website and Landing Pages.
4. Open any Google Analytics report (reports starting with ‘GA Report’).
5. On the top right corner of the page, click the settings icon.
6. Enter the Client ID generated in previous steps. Close the popup, then click Run Report.
7. If the Client ID is correct and the URL whitelisting was done correctly, you’ll see an Access Google Analytics button. Click this button to proceed.
8. A Google Sign in pop window will appear. Log in with the same Gmail ID you used for the settings in the Google Developer Console.
9. The following warning screen may appear. You can either submit a verification request to remove this screen. Or Click Advanced.
10. After clicking on advanced, click the Go to leadsquared.com (unsafe) link.
11. Click to Allow to grant LeadSquared the required permissions.
12. Click to confirm granting all permissions.
13. Once the permissions are confirmed, the report will load. You can now select any Google Analytics account associated with your Gmail ID.
Note: This is a one-time setup. You can now load any other Google Analytics report in LeadSquared without entering your Client ID or granting permissions.
Any Questions?
If you have trouble with the setup or any feedback on the article, please share your feedback in the comments below.