Back to Kodaris

Operations Marketing - Connecting Google Analytics to Your Commerce Website

  1. Log into your Google Analytics account

    To add Google Analytics to your website, log into your Google Analytics account. If you do not have one already, you will need to create one.

  2. Click "Create"

    To begin the process of adding Google Analytics to your Commerce website, select the "Create" button once logged in.

  3. Click "Property"

    To measure your web data, you will need to create a Google Analytics property. To do so, click "Property".

  4. Give your property a name

    Fill out the required information on this page. Start by giving your property a name, such as the name of your website.

  5. Choose your time zone

    Choose your time zone.

  6. Select the currency

    Select the currency in which you do business.

  7. Click "Next"

    Click the "Next" button.

  8. Choose the industry

    Choose the industry that best describes your business from the dropdown list.

  9. Select your business size

    Select the size that best matches your business.

  10. Click "Next"

    Click the "Next" button.

  11. Choose your business objective(s)

    Select as many of the objectives from this list that best match the topics that are most important to your business. You can select one, just a few, or all of the options.

  12. Click "Create"

    Select the "Create" button.

  13. Select "Web"

    Next, to set up data collection, choose the platform from where you will be collecting data. Since this is for your Commerce website, select "Web".

  14. Add website URL

    Add your website's URL.

  15. Add a name for your data stream

    Add a name for your data stream.

  16. Click "Create & continue"

    Click the "Create and continue" button.

  17. Confirm the new data stream was added

    You will now see the new data stream listed. Confirm it is the one you just created.

  18. Click "Next"

    Click the "Next" button.

  19. Select "Install manually"

    Now that the data stream is set up, Google will prompt you to add the tracking code to your website. To do this, select "Install manually".

  20. Close out of the page

    Click the "X" in the upper left-hand corner of the page to close out of it.

  21. Copy the "Measurement ID"

    A new page will automatically open with additional information about the data stream. To configure your website to track analytics, copy the "Measurement ID".

  22. Click "Marketing"

    Navigate to the Operations Portal and select "Marketing" from the main navigation.

  23. Click "Google Analytics"

    Select "Google Analytics".

  24. Paste the "Measurement ID"

    Paste the "Measurement ID" that was recently copied into the text box.

  25. Click "Save"

    Click the "Save" button to save your changes.

  26. Click "Inspect"

    To check on the script, navigate to your website. Once on your website, right-click and select "Inspect" to view the website's scripts.

  27. Click on the "Console" tab

    Select the "Console" tab.

  28. Locate the error

    You'll notice that there will be an error that says, "Refused to load the script". This error pertains to the new script you just added. If you do not see an error, reload the page. This error is because only certain script sources are allowed on your website by default and for security purposes. Generally speaking, you should only allow script sources that you trust. Because Google Tag Manager is a trustworthy source, you need to whitelist it. Whitelisting the script will allow your website to load the script from Google Tag Manager.

  29. Copy the website domain

    To whitelist the script, highlight and copy the website domain located in the error notification.

  30. Search "Security"

    Head back to the Operations Portal, and search "Security" in the search bar.

  31. Click "Security"

    Click the "Security" tab.

  32. Paste the URL

    On this page, scroll to the heading titled "Script-src" under the "Content Security Policy" section. To whitelist Google Tag Manager, paste the URL you recently copied into the text box along with the other whitelisted domains. When pasting the URL, make sure there is a space separating the previous link with the new one you are adding.

  33. Click "Save"

    To save your changes, click the "Save" button.

  34. Confirm the error no longer exists

    Head back to your website and refresh the page. View the source code to ensure the error that was previously shown no longer exists. After following these steps, Google Analytics will now be connected to your Commerce website. You can begin viewing insights in your Google Analytics account after just a few minutes.

In this article