Happy to answer your further queries here @sakowporg, and sorry if there was any confusion.
I copy the reseted staging site and overwrite the production site with it. Then I reset the site kit plugin on production. And on a next intervall it will gather all original metrix but also correctly implement the new pages and sitemaps. Everything is as it should, right?
This is where I may have been confused. Typically, Site Kit should be reset on staging <span style=”text-decoration: underline;”>before</span> migrating to production if the plugin was already setup on staging (using a staging site URL). In your case, if you’re copying files over and you don’t have Site Kit set up already on staging, this may not be a concern assuming the plugin is already working on production. Site Kit stores minimum information in a users WordPress database. As long as your site URL is not changing, and your WordPress constants (ie. Salt Keys) are not changing when migrating from staging to production, the plugin should remain intact if the Site Kit plugin directory remains present.
Note that depending on the migrating tool you’re using to push from staging to production, there may be other concerns. (ie. Does each update replace all your existing plugin directory files, does it use your existing production database or a new one).
With regards your query on sitemaps, Site Kit doesn’t register any sitemap data or display any sitemap information. The plugin therefore doesn’t register any such information in a users database.
What exactly do you mean by “…you will need to connect all modules…” Will I not only have to reset the Site Kit plugin, but then also redo the wizard?
If after migrating from staging to live, depending on what changes are made, the plugin may ask you to complete set up once more (ie. If you WordPress constants change). You may not need to go through the full setup process (ie. with Analytics), as the connected services may remain intact as long as your site isn’t reset. If your site URLs are not changing with your migration plugin, you do not need to reset first. Apologies for any confusion here.
Why do you say the URL is different? When I copy staging to production my transfer tool will search and replace all staging URLs to become the original production URLs. So when after that I reset the Site Kit plugin the URL of production is the same as it was before the overwriting from staging. It just has some changed pages and sitemaps. So will I lose all recorded visitor data for all pages, or only for those pages that have changed content or another position within the sitemap -> another permalink?
Thanks for mentioning how your migration tool operates. You won’t loose any Analytics or other data on your live site after migrating from staging to live in this case. As stated above, if you’re WordPress constants are changed, you may need to set up the plugin once more, but once complete the modules remain intact. Even if you happen to perform a plugin reset, whereby Analytics and other modules become disconnected, you can always go ahead and connect then once more. As Site Kit pulls data from the relevant services (ie. analytics.google.com), your data is not “lost”.
Hopefully the above is a bit clearer. What I would suggest when migrating from staging to live, is to not reset the plugin if your site URLs are not changing. If your WordPress constants are changing, I can provide you with a filter to ensure you are not asked to set up the plugin with each push from staging to production. If you want to share any tool you’re using to perform updates from staging to production, I can also check what configurations are available and assist with this further.
