How to show Google Analytics (GA4) data on your website frontend?

By default Google Analytics (GA4) does not provide any embed code to show the analytics data on website front end. However this can be achieved by connecting your GA4 account with Looker Studio.

Looker Studio provides the emendable report URL which can be used in the website. To achieve this, refer below steps:

  1. Go to https://lookerstudio.google.com/navigation/reporting
  2. Choose “GA4 Report” from listed templates. This will open the default template with the data pre-populated
  3. Now click on “Use my own data” button on top right
  4. This will ask you to authorise the connection with your GA4 account. Click on “Authorize”
  5. Select the appropriate account and then click on “Add” button on the bottom right
  6. Select “Country”, “Company”, then accept the terms by ticking the checkbox and click on “Continue” button
  7. Choose Yes/No based on if you want to subscribe to any of Looker Studio newsletter topics and click on “Continue” button
  8. The popup will appear, click on “Add to report” button
  9. Now the template will populate the data from your GA4 account
  10. Click on “Edit and Share” button on top right
  11. Click on the small dropdown adjacent to “Share” button on the top right and then click on “Get report link”
  12. This will open a pop-up with a link which you can copy. Before that click on “View sharing setting” link shown in the popup.
  13. In the next step, choose “Public” or “Unlisted” as per your requirement
  14. Click on “Save”. Then click on the small dropdown that appears besides “Share” button, and click on “Embed Report”.
  15. Copy the Embed code and paste it in “HTML block” in your WordPress site. This will look like below.

Leave a Reply