Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to Google Analytics 4 #3863

Closed
12 of 27 tasks
Tracked by #1730
JessicaLucindaCheng opened this issue Jan 24, 2023 · 16 comments · Fixed by #4904
Closed
12 of 27 tasks
Tracked by #1730

Migration to Google Analytics 4 #3863

JessicaLucindaCheng opened this issue Jan 24, 2023 · 16 comments · Fixed by #4904
Assignees
Labels
Complexity: Large Feature: Analytics google analytics role: dev leads Tasks for technical leads size: 3pt Can be done in 13-18 hours time sensitive Needs to be worked on by a particular timeframe

Comments

@JessicaLucindaCheng
Copy link
Member

JessicaLucindaCheng commented Jan 24, 2023

Overview

Since Google's Universal Analytics (UA) will stop processing hits on July 1, 2023, we need to migrate from UA to Google Analytics 4 (GA4) so that our website will continue to gather site usage data.

Important

We need to export our Universal Analytics (UA) data by December 31, 2023 in order to have that record for the future.
From Universal Analytics is going away

  • After July 1, 2023, you'll be able to access your previously processed data in your Universal Analytics property for at least six months. We know your data is important to you, and we strongly encourage you to export your historical reports during this time.

Details

We strongly recommend you manually migrate your Universal Analytics settings to GA4. If you do nothing, a new GA4 property will automatically be created for you, and your Universal Analytics configurations will be copied to the new GA4 property. Not all UA configurations have an obvious GA4 counterpart, and the automated process might not make the same choices as you would.

Action Items

  • You must be a Technical Lead or Merge Team member to self-assign this issue
  • You will need access to
    • 1) Hack for LA's 1Password and
    • 2) the [email protected] account sign-in information within Hack for LA's 1Password.
    • 3) HfLA Website Admin Google Drive
    • If you do not have access to any of the above, you will need to ask a Product Manager on the Website Team for access.
  • Depending on when you work on this issue, Google may have already automatically migrated us to GA4. Check if the migration has happened and do the appropriate set of Action Items below.

If migration from UA to GA4 has not happened yet

  • Research what needs to be done to migrate to GA4, including (but not limited to):
    • What changes may happen with the migration?
    • With the migration from UA to GA4, are any features deprecated?
  • In a new comment below, write up your research findings
  • Discuss your findings with other dev leads (Merge Team members and Technical Leads) and the Product Managers at a meeting
  • Get approval from a Product Manager to proceed with the migration
  • After receiving approval from a Product Manager, migrate from UA to GA4
  • Make sure the website's analytics work properly after the migration. According to Google's documentation,

    It can take up to 30 minutes for data to begin appearing in your new GA4 property.

    To verify that data is being collected, browse your website, then select Realtime from the report navigation. You should see activity in the Realtime report

  • After GA4 has been set up properly, export all UA analytics data in every format described in Ways to export Google Analytics data and place it in the Google Universal Analytics Data folder in the HfLA Website Admin Google Drive.

If the migration from UA to GA4 already happened

  • You'll need to see what configurations and properties we had before in UA and make sure the GA4 is set up to function the same way the UA did in terms of the analytics we gather.
  • Research:
    • What changes happened with the automatic migration?
    • With the migration from UA to GA4, were any features deprecated?
    • What changes (if any) to the configurations and properties need to happen to the GA4 so it functions the same way the UA did in terms of the analytics we gather?
  • In a new comment below, write up your research.
  • Discuss your findings with other dev leads (Merge Team members and Technical Leads) and the Product Managers at a meeting
  • Get approval from a Product Manager to proceed with changing configuration and properties for the GA4 (if changes are needed)
  • After receiving approval from a Product Manager, proceed with changing the configuration and properties for the GA4 (if changes are needed)
  • Make sure the website's analytics work properly after making changes to GA4. According to Google's documentation,

    It can take up to 30 minutes for data to begin appearing in your new GA4 property described in Ways to export Google Analytics data

    To verify that data is being collected, browse your website, then select Realtime from the report navigation. You should see activity in the Realtime report

  • After GA4 has been set up properly, export all UA analytics data in every format and place it in the Google Universal Analytics Data folder in the HfLA Website Admin Google Drive.

Resources/Instructions

@JessicaLucindaCheng JessicaLucindaCheng added role: back end/devOps Tasks for back-end developers Complexity: Large Feature: Analytics google analytics time sensitive Needs to be worked on by a particular timeframe size: 2pt Can be done in 7-12 hours role: dev leads Tasks for technical leads size: 3pt Can be done in 13-18 hours Ready for Prioritization and removed size: 2pt Can be done in 7-12 hours labels Jan 24, 2023
@JessicaLucindaCheng

This comment was marked as resolved.

@JessicaLucindaCheng JessicaLucindaCheng added Draft Issue is still in the process of being created and removed Ready for Prioritization labels Feb 7, 2023
@JessicaLucindaCheng

This comment was marked as resolved.

@ExperimentsInHonesty ExperimentsInHonesty added this to the 03.01 Roadmaps milestone Mar 5, 2023
@JessicaLucindaCheng JessicaLucindaCheng removed the role: back end/devOps Tasks for back-end developers label Mar 27, 2023
@JessicaLucindaCheng

This comment was marked as resolved.

@JessicaLucindaCheng JessicaLucindaCheng added Status: Help Wanted Internal assistance is required to make progress Blockers Draft Issue is still in the process of being created and removed Draft Issue is still in the process of being created labels Mar 27, 2023
@JessicaLucindaCheng JessicaLucindaCheng self-assigned this Mar 28, 2023
@JessicaLucindaCheng JessicaLucindaCheng added Ready for Prioritization and removed Status: Help Wanted Internal assistance is required to make progress Blockers Draft Issue is still in the process of being created labels Mar 29, 2023
@JessicaLucindaCheng
Copy link
Member Author

JessicaLucindaCheng commented Mar 29, 2023

@jdingeman @ExperimentsInHonesty I know we had discussed waiting for Google to migrate us over automatically to Google Analytics 4 but I don't know how long we have to wait until the migration; Google said they would start in March 2023 but didn't give us a date when they expect to complete automatically migrating all accounts. Thus, I decided to make this issue so it would work for both if the automatic migration already happened and if it didn't happen yet because even with the automatic migration, we still might need to do some manual changes to configurations and properties according to Google:

We strongly recommend you manually migrate your Universal Analytics settings to GA4. If you do nothing, a new GA4 property will automatically be created for you, and your Universal Analytics configurations will be copied to the new GA4 property. Not all UA configurations have an obvious GA4 counterpart, and the automated process might not make the same choices as you would.

@t-will-gillis
Copy link
Member

Availability: 5/19-5/25 daily
ETA: tbd

@t-will-gillis
Copy link
Member

Update: I have a blocker

While I now have access to the password for the [email protected] account, the sign in for the 'Admin' link to Google Analytics also requires a Secret Key. Unless I am missing something, I believe that I need the key to continue on to Google Analytics.

@JessicaLucindaCheng
Copy link
Member Author

@t-will-gillis

  1. Please move this issue to the In Progress column
  2. Did you get an answer to your blocker?

@ExperimentsInHonesty
Copy link
Member

@t-will-gillis I found a spreadsheet that had some other codes in it. I assumed they were old passwords, but I think one of them might be the key. Can you review them in the Google Analytics 1 password record and see if any of those work for you?

@ExperimentsInHonesty
Copy link
Member

@t-will-gillis Before you do any conversions, can you download the stats by year. See this for an example, but obviously it would be better as a csv.

PDF of stats per page for 2021 (printout from Google Analytics)

@ExperimentsInHonesty
Copy link
Member

ExperimentsInHonesty commented Jun 4, 2023

Got this email in [email protected]

Your Google Analytics account needs immediate attention. Our next-generation measurement solution, Google Analytics 4, is replacing Universal Analytics. Starting July 1, 2023, standard Universal Analytics properties will stop processing new data. If you use Google Ads, this means that any Universal Analytics data that you're using for ad campaigns will start to degrade and your ad performance may be impacted. We strongly recommend that you follow our step-by-step guide to make the switch to Google Analytics 4 as soon as possible

SET UP GOOGLE ANALYTICS 4

To build data and continuity in Google Analytics 4, it is essential that you start your setup now. This will allow you to start collecting the right data in Google Analytics 4 for your unique needs, and help avoid disruption to any Google Ads campaigns still relying on Universal Analytics conversions and audiences.

Unless you've opted out, we've already configured or soon will configure a Google Analytics 4 property for you with some basic features, including certain goals and Google Ads links moved over from your Universal Analytics configuration. But parts of your existing Universal Analytics setup, including custom dimensions and metrics, cannot be moved. Customizing your Google Analytics 4 setup now will ensure you collect the right data for the specific conversions, audiences, and other Analytics data that you care most about, so you can continue to measure your most valuable actions and run more efficient ad campaigns.

For what to expect for Universal Analytics next month, visit the Help Center. - you have to be logged into [email protected] to see this

See you online,
The Google Analytics Team

@t-will-gillis
Copy link
Member

@t-will-gillis Before you do any conversions, can you download the stats by year. See this for an example, but obviously it would be better as a csv.

PDF of stats per page for 2021 (printout from Google Analytics)

@ExperimentsInHonesty which Google Drive folder is this linking to? It says I don't have access through '[email protected]'- I'll send a request for access

@github-actions github-actions bot added the To Update ! No update has been provided label Jun 16, 2023
@github-actions
Copy link

@t-will-gillis

Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.

  1. Progress: "What is the current status of your project? What have you completed and what is left to do?"
  2. Blockers: "Difficulties or errors encountered."
  3. Availability: "How much time will you have this week to work on this issue?"
  4. ETA: "When do you expect this issue to be completed?"
  5. Pictures (optional): "Add any pictures of the visual changes made to the site so far."

If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel. Please note that including your questions in the issue comments- along with screenshots, if applicable- will help us to help you. Here and here are examples of well-formed questions.

You are receiving this comment because your last comment was before Tuesday, June 13, 2023 at 12:16 AM PST.

@t-will-gillis t-will-gillis removed the To Update ! No update has been provided label Jun 16, 2023
@t-will-gillis
Copy link
Member

t-will-gillis commented Jun 16, 2023

  • I have begun downloading numerous reports from Universal Analytics, 2020, 2021, and 2022 in both PDF and csv formats.
  • On the day of migration, I plan to download the remaining report for 2023 and for all time up till that date.
  • I looked at whether the UA data can simply migrate to GA4- short answer is no:

Can You Migrate Your Data To GA4?
The primary concern is whether GA users can transfer or migrate Universal Analytics data into their Google Analytics 4 property. Unfortunately, you cannot migrate your data to GA4, and it’s not likely to be a feature we’ll see added in the coming months. Migrating your data to GA4 is not likely to be a feature because the two versions use completely different data models.
I spoke with Charles Farina, Head of Innovation at Adswerve, and he explained that: “It is the difference in schema and dimension definitions/calculations that make merging the data not possible.” Schema refers to how the data is organized and the language used to ensure compatibility. Essentially it is the blueprint. He explains you can see the differences in schema well when comparing the BigQuery integrations for UA and GA4.
“The UA export is sessionized, meaning each row in the export is a session, and every interaction is nested in that row. The [GA4 export] (https://support.google.com/analytics/answer/7029846?hl=en) is very different, where each row is the event (interaction) itself,” shared Farina.
Another key reason is how dimensions and metrics are defined and calculated in GA4 compared to UA.
Google has a great support page that goes over many of these. For example, let’s look at one of the most common KPIs, “Users.” Universal Analytics reports on Total Users or all users, while GA4 focuses on Active Users or users that have visited the website at least once in the past 28 days. Even if we could migrate UA data to GA4, it would be like comparing apples to oranges. If you’re wondering why this change is happening, you’ll find the answer in our article, [Google Analytics 4 FAQs: Stay Calm & Keep Tracking]
https://www.searchenginejournal.com/google-analytics-4-faqs/446167/

What’s the difference between UA and GA4?
Google Analytics 4 doesn’t just offer more of what Universal Analytics offers. It’s built differently to align with current and future needs for reporting and privacy. Here are some of the differences and benefits.
• Event-based: Universal Analytics is session-based, while GA4 is event–based. In other words, the ability to track events like button clicks, video plays, and more is built in with GA4, while this requires advanced setups in UA. This comes from the premise that page views aren’t the sole important metric.
• Cross-device tracking: UA was built around desktop web traffic, while GA4 gives businesses visibility into the customer journeys across all of their website and apps.
• Machine learning: GA4 uses machine learning technology to share insights and make predictions.
• Privacy-friendly: UA data relies heavily on cookies, GA 4 does not.
Click to enlarge
You can also read Google’s explanation of UA vs GA4 here.

@t-will-gillis
Copy link
Member

t-will-gillis commented Jun 27, 2023

Note: As of 6/30/23 at 9 pm, it appears that since we made the changes and linked the new GA4 property to the UA property, we are already collecting data and we might not need to make any additional changes to the website.

Goal conversions

The previous goals (i.e. Donate button, Government Survey button, etc.) have been converted to GA4 format. Post migration will confirm these are functioning.

Google Site Tag

These are all files that are using the Global Site Tag | gtag.js | UA-167506267-1 with 'googletagmanager'.

Per Google, it appears that we can continue using the existing gtag :

[GA4] About connected site tags
This article is for website owners who are setting up a Google Analytics 4 property and who are given the option (by the GA4 setup wizard) to reuse their existing Universal Analytics tagging.
If your Universal Analytics property uses gtag.js or analytics.js (including if analytics.js was deployed through a tag management system like Google Tag Manager), the GA4 Setup Assistant wizard can reuse your existing tagging (i.e., the tag being used by your Universal Analytics property). This tag reuse saves you from having to add the tag manually to your web pages and is made possible via a feature called connected site tags.

The Google docs give many options for . need to replace:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-167506267-1"></script>
<script>  
  window.dataLayer = window.dataLayer || [];   
  function gtag(){dataLayer.push(arguments);}  
  gtag('js', new Date());  
  gtag('config', 'UA-167506267-1'); 
</script>
 <! -- End Google tag -->

by adding new GA4 tag config after the UA tag config:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-167506267-1"></script>
<script>  
  window.dataLayer = window.dataLayer || [];   
  function gtag(){dataLayer.push(arguments);}  
  gtag('js', new Date());  
  gtag('config', 'UA-167506267-1'); 
  gtag('config', 'G-QNFX2EYZC8');
</script>
<! -- End Google tag --> 

This is the failsafe if the above addition of the new gtag does not function as intended for whatever reason, there is the option to replace the gtag completely with GA4 tags:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QNFX2EYZC8"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-QNFX2EYZC8');
</script>

Google Tag Manager

We have four additional files referencing Google Tag Manager | gtm.js | GTM-PMQK7VL:

Note: Per analyticsmania, it appears that Google Tag Manager does not need to be updated when switching from UA to GA4. Will need to verify after migrating to GA4. Therefore, the embedded code will not change:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PMQK7VL" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

Finally, the Google tag and Google Tag Manager should be reversed so that Google tag is first.

@t-will-gillis
Copy link
Member

t-will-gillis commented Jun 29, 2023

@ExperimentsInHonesty @JessicaLucindaCheng

Please see the above explanation of the changes that may need to be made. The GA4 property is created and the goals are converted already. The GA4 property is connected to the existing UA property. The Google Tag Manager does not need to be updated.

Note: As of 6/30/23 at 9 pm, it appears that with the changes and linking the new GA4 property to the UA property, we are already collecting data without making changes to the website.


![Migration_015](https://github.com/hackforla/website/assets/40799239/2864aeae-1857-4ccc-9fc7-71298f3e7252)
From my research, I believe these are the important things to note:
  1. UA collects data per session, GA4 data is per event. The UA data is incompatible/ not transferable to GA4 for this reason.
    I have been saving PDFs and csvs of all data that seems relevant to me, but I don't think I am saving every possible query of the data. Therefore if there is any data that is very important, please let me know so that I can be sure that I am saving it. FYI- from what I am reading I believe UA data will be available for a few months still but I will finish saving file before migrating.

    UA-vs-GA4
  2. From what I have researched, we should be able to migrate most if not all of our current settings because we don't have that many. Using the GA4 Setup Assistant, we are able to monitor that new properties are created in GA4 based on existing properties that we currently have with Universal Analytics.
    a. This includes the Google Site Tag referenced above UA-167506267-1
    i. I have screen shots of all settings to verify that the migration tool is creating a similar setting.
    ii. It appears that GA4 will migrate most if not all of our current settings. In HfLA it appears the most developed analytic settings are for Goals. GA4 has a Goals Migration Tool to try to emulate the same kinds of data collection.
    iii. Again, there will be differences in future data collection because GA4 is measuring per event while UA is measuring per session.
    b. The Google Tag Manager referenced above GTM-PMQK7VL will also migrate with GA4.

@t-will-gillis
Copy link
Member

  • GA4 appears to be functioning as we intended based on previous settings in UA- after doing the setup steps in GA4 it appears we are up and running without the need to change any code
  • More details:
    o We have existing Google tracking as ‘Google Site Tag’ in _include/head.html and _layouts/redirect.html. Although there is a new GA4 code available, the previous UA code is tied to GA4 without us needing to make any changes.
    o The existing tracking from ‘Google Tag Manager’ (present in 5 files) is reusable by GA4, thus no changes here either.
    o The previous UA ‘Goal’ settings have been converted to a GA4 format/ event and appear to be functioning.
    o There is an associated PR Migration to GA4 - 3863 #4904 that:
    a.) adds html comments,
    b.) reformats the Google tags for readability only, and
    c.) switches the order of the ‘Google Site Tag’ and ‘Google Tag Manager’ per the recommendation of Google.

HOWEVER: since everything appears to be working, we might not want or need to make these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Large Feature: Analytics google analytics role: dev leads Tasks for technical leads size: 3pt Can be done in 13-18 hours time sensitive Needs to be worked on by a particular timeframe
Projects
Development

Successfully merging a pull request may close this issue.

3 participants