How to Set Up Google Analytics for Your Website: A Step-by-Step Guide
Google Analytics is a powerful tool that helps website owners track and analyze their site's traffic. This guide will show you how to create a Google Analytics account, add your Google Analytics tracking code, and view live traffic stats on your website dashboard.
Step 1: How to Create a Google Analytics Account
If you don't have a Google Analytics (GA) account, setting one up is easy and free. Follow these steps to create your account:
Go to Google Analytics: Click here to access Google Analytics. If you're not signed in, click Sign in to Analytics. If you don't have a Google account, click Start for free.
Create a New Account:
Enter your account name (typically, your website or business name) and click Next.
Enter your property name (e.g., your website name or domain) and click Next.
Add Your Business Information: Fill in the required business details and click Create.
Set Your Business Goals: Choose your business objectives and click Create.
Agree to the Terms: Review and accept the Google Analytics Terms of Service Agreement.
Select 'Web' as Your Platform: Choose the Web option and enter your website’s URL in the Website URL field, then click Create.
Congratulations, your Google Analytics account is now set up!
Step 2: How to Add Google Analytics Tracking Code and Property ID to Your Website
Once you've set up Google Analytics, the next step is to integrate it with your website. Here’s how you can add your GA tracking code and Property ID to your site:
Adding the Google Analytics Tracking Code
In your Google Analytics account, click on the Admin gear icon (bottom left).
Under the Property column, click Data Streams and then Add Stream.
Choose Web and enter your website's URL and a name for the stream.
Copy the Measurement ID displayed in your stream settings.
Inserting the GA Tracking Code in Your Site
Go to your website’s admin dashboard (e.g., WordPress) and navigate to Sellvia → Reports → Traffic Report → GA4 Tracking ID.
Paste the copied Measurement ID into the field.
Adding the Property ID
In Google Analytics, return to the Admin gear icon and go to Property Settings.
Copy the Property ID.
Paste the Property ID into your website’s backend: Sellvia → Reports → Traffic Report → G4Property ID.
Step 3: How to Display Google Analytics Live Stats on Your Dashboard
To view live Google Analytics stats directly on your site’s dashboard, follow these steps:
Go to the Google Developer Console: Select your country and agree to the Terms of Service.
Create a New Project:
Click Create Project or select New Project.
Enter your project name and click Create.
Enable Google Analytics Data API:
Navigate to API & Services > Enable APIs and Services.
Scroll down to Google Analytics Data API and click Enable.
Set Up OAuth Consent Screen:
Click OAuth consent screen on the left panel.
Choose the External user type, then click Create.
Enter your app name and support email.
In the Authorized domains section, click +Add domain and enter your website's domain name.
Provide your Developer contact information (your email address) and click Save and continue.
Save Settings:
For Scopes click Save and continue.
In Test users, add the same email address used for your Google Analytics account.
Once done, click Back to Dashboard and then click Publish app.
Create OAuth Credentials
In the Google Developer Console, go to Credentials → Create Credentials and choose OAuth Client ID.
Select Web application as the application type, and name the credential.
Under Authorized redirect URIs, click +ADD URI and paste the URL from your site’s backend (e.g., Sellvia → Traffic Report).
Click Create.
Add Client ID and Secret to Your Website
Copy the Client ID and Client Secret displayed on the screen.
Paste these values into your website’s admin area: Sellvia → Reports → Traffic Report.
Click Continue to complete the integration.
Once the connection is established, it may take up to 48 hours for your Google Analytics data to appear on your dashboard.
By following these steps, you’ll have Google Analytics set up on your website and ready to track live traffic data. Integrating Google Analytics with your site helps you gain valuable insights into your website performance, audience behavior, and much more. With the live stats now visible on your dashboard, you can monitor your website’s traffic in real time and make informed decisions to improve your online presence.