Loading
Feature degradation | Gmail Email delivery failureRead More

Migrate Experience Cloud Aura Sites to Google Analytics 4

Publish Date: Aug 6, 2023
Description
On July 1, 2023, Google is retiring Universal Analytics and replacing it with Google Analytics 4 (GA4). After this date, Universal Analytics properties will stop processing data. To continue collecting analytics data, Experience Cloud sites must use GA4 properties. LWR sites aren’t affected by this change. To learn more about the changes to Google Analytics, see “Universal Analytics will be going away” on Google’s Help Center.
Resolution
If your organization has Aura sites that use Universal Analytics, complete the migration process to GA4 before July 1, 2023. You must complete these steps in order. 
 
  1. Upgrade your JavaScript site libraries from analytics.js to gtag.js.
  2. Update your Google Analytics ID for each affected Aura site from a UA-ID to a G-ID. 

To obtain a G-ID to use in step two, Google may require you to complete additional migration steps. To learn more, see “Set up analytics” on Google’s Help Center.

 

Upgrade Your JavaScript Site Libraries

To upgrade all of your Aura site JavaScript libraries from analytics.js to gtag.js simultaneously, enable the Migrate Aura Sites to Google Analytics 4 release update. This release update is available when your org is upgraded to the Spring ’23 release. Salesforce enforces this release update in Summer ’23.

Note: The gtag.js library supports the same functionality as the analytics.js library, and no interruptions to your configurations are expected. However, due to the customized nature of analytics configuration and use cases, we highly recommend that you enable the release update in a developer or sandbox org before updating your production org. After enabling the update in a sandbox org, review your analytics flows to confirm that everything works as expected. This release update doesn’t include a test run and can’t be reverted after it’s enabled.
 
  1. For each of your Aura sites, navigate to Experience Builder, click Settings > Updates, and check for pending updates before you enable the release update. If a site has a pending update, it indicates that the site uses the analytics.js library and will be upgraded when you enable the release update. It’s possible for one site to use the gtag.js library and another site to use the analytics.js library. Make a note of which Aura sites use the analytics.js library so you can review those sites after you enable the release update. 
  2. In a sandbox or developer org, from Setup, enter Release Updates in the Quick Find box, then select Release Updates
  3. Click Get Started on the Migrate Aura Sites to Google Analytics 4 release update. 
  4. To enable the release update in your sandbox or developer org, follow the steps listed in the release update.
  5. After you enable the release update, republish each of the upgraded Aura sites in the developer or sandbox org. 
  6. Review each upgraded Aura site’s analytics data collection flow from end-to-end and ensure that data is collected as expected. Resolve any identified issues. Be sure to enable any configuration changes in your production org. 
  7. After you confirm that the upgrade works as expected for your Aura sites in a developer or sandbox org, enable the release update in your production org. Be sure to republish the upgraded Aura sites in your production org after you enable the update.
 

Update Your Google Analytics ID for Each Aura Site


After you upgrade your site JavaScript libraries to gtag.js, manually update each Aura site’s Google Analytics ID from a UA-ID to a G-ID. Your site isn’t migrated to GA4 until you complete this manual step. 

Note: If you don’t update to a G-ID by the time Google stops processing data through Universal Analytics properties, you can lose future site analytics data. To obtain a G-ID, Google may require you to complete additional migration steps. You must upgrade a site’s JavaScript library before you update the site to a G-ID.
 
  1. Go to Experience Builder > Settings > Advanced > Google Analytics
  2. Replace the existing UA-ID with a G-ID. If you cannot update the GID, deactivate the Google Analytics CSP URLs in the builder, and then update the G-ID that gives you confirmation of saving it. After the GID is saved, then we need to reactivate the CSP URLs in the builder.
  3. To learn how to find your G-ID, see “Find your ‘G-’ ID” in Google’s Help Center.
  4. Repeat these steps for any of your Aura sites that use Google Analytics. 
Knowledge Article Number

000393702

 
Loading
Salesforce Help | Article