• Resolved Marcus

    (@power2009)


    Hello Beehive Analytics Support Team,

    I’ve encountered an issue with the “Top Countries” GeoChart in Beehive Analytics (version 3.4.16) that prevents it from rendering correctly out of the box. The console shows a “Type mismatch” error related to data processing, which I managed to fix with a workaround. Below is a detailed explanation of the issue, diagnostic steps, the fix, and additional warnings that persist. Issue 1: “Type mismatch” Error in GeoChart

    • Error Message:
      chunk-vendors.min.js?ver=3.4.16:81 Error: Type mismatch. Value 0 does not match type number in column index 1
          at gvjs_yk (jsapi_compiled_default_module.js:277:264)
          at gvjs_M.<anonymous> (jsapi_compiled_default_module.js:294:194)
          at gvjs_M.<anonymous> (jsapi_compiled_default_module.js:295:73)
          at o.setupList (chunk-common.min.js?ver=3.4.16:1:43105)
          at o.onChartReady (chunk-common.min.js?ver=3.4.16:1:43611)
          at zn (chunk-vendors.min.js?ver=3.4.16:81:24932)
          at o.n (chunk-vendors.min.js?ver=3.4.16:81:14729)
          at zn (chunk-vendors.min.js?ver=3.4.16:81:24932)
          at o.$emit (chunk-vendors.min.js?ver=3.4.16:81:30959)
          at chunk-vendors.min.js?ver=3.4.16:191:5754
    • Description: The GeoChart in the “Top Countries” section fails to render, showing the above error in the browser console. This indicates that the Google Visualization API (GeoChart) received a non-numeric value in the sessions column (index 1), which should always be a number.
    • Cause: After debugging, I found that the stats.countries array from Google Analytics contains an entry ["(not set)", "(not set)", "0"], where the session value "0" is a string instead of a number. The GeoChart expects numeric values in column 1, and this mismatch causes the error.

    Initial Debugging:

      • Added console.log('Raw stats for countries:', t.stats.countries) to setupList in chunk-common.min.js.
      • Output: stats.countries contains 27 entries, including ["(not set)", "(not set)", "0"] with a string "0".
      • Confirmed that other entries (e.g., ["Italy", "IT", 48]) have numeric session values.

        Data Processing Check:

        • Inspected the setupList method, which builds a DataTable for GeoChart:
          javascript s.addColumn("string", this.$i18n.label.country); s.addColumn("number", this.$i18n.label.sessions); s.addColumn({ type: "string", role: "tooltip", p: { html: !0 } }); Object.keys(t.stats.countries).forEach(function (s) { e.push([t.stats.countries[s][0], t.stats.countries[s][2], t.geoToolTip(...)]); }); s.addRows(e);
        • Found that t.stats.countries[s][2] (session value) is passed directly to e without type conversion, so "0" remains a string.
        1. Reproduction:
        • Connected Beehive Analytics to a Google Analytics property.
        • Navigated to the Analytics dashboard in WordPress admin.
        • Opened the “Top Countries” section and checked the console, confirming the error.

        Fix Applied

        To resolve the “Type mismatch” error, I modified the setupList method in chunk-common.min.js to:

        • Convert session values to numbers explicitly.
        • Filter out the invalid “(not set)” entry.

        Original Code (simplified):

        setupList: function () {
            if (!this.isEmpty && this.chartApi) {
                var t = this, e = [], s = new this.chartApi.visualization.DataTable();
                s.addColumn("string", this.$i18n.label.country);
                s.addColumn("number", this.$i18n.label.sessions);
                s.addColumn({ type: "string", role: "tooltip", p: { html: !0 } });
                Object.keys(t.stats.countries).forEach(function (s) {
                    e.push([t.stats.countries[s][0], t.stats.countries[s][2], t.geoToolTip(...)]);
                });
                s.addRows(e);
                this.chartData = s;
            }
        }

        Modified Code:

        setupList: function () {
            if (!this.isEmpty && this.chartApi) {
                var t = this, e = [], s = new this.chartApi.visualization.DataTable();
                s.addColumn("string", "Country");
                s.addColumn("number", "Sessions");
                s.addColumn({ type: "string", role: "tooltip", p: { html: true } });
                console.log('Raw stats for countries:', t.stats.countries);
                Object.keys(t.stats.countries).forEach(function (s) {
                    var countryName = t.stats.countries[s][0];
                    var sessionValue = t.stats.countries[s][2];
                    var tooltip = t.geoToolTip(t.stats.countries[s][0], t.stats.countries[s][1], sessionValue);
                    var numericValue = Number(sessionValue);
                    if (isNaN(numericValue)) numericValue = 0;
                    if (countryName === "(not set)") {
                        console.log('Skipping (not set):', countryName, numericValue);
                        return;
                    }
                    console.log('Country:', countryName, 'Sessions (raw):', sessionValue, 'Sessions (numeric):', numericValue);
                    e.push([countryName, numericValue, tooltip]);
                });
                console.log('GeoChart data before DataTable:', e);
                if (e.length === 0) {
                    console.log('No valid countries to display');
                    this.chartData = {};
                    return;
                }
                s.addRows(e);
                this.chartData = s;
                console.log('Final chartData (DataTable):', this.chartData);
            } else {
                this.chartData = {};
            }
        }

        Result:

        • After applying this fix, the GeoChart renders correctly with 26 valid countries (excluding “(not set)”).
        • Console log example:
          Raw stats for countries: [["Italy", "IT", 48], ..., ["(not set)", "(not set)", "0"]]
        Country: Italy Sessions (raw): 48 Sessions (numeric): 48
        ...
        Skipping (not set): (not set) 0
        GeoChart data before DataTable: [["Italy", 48, "<tooltip...>"], ...]
        Final chartData (DataTable): <gvjs_M object with 26 rows>
        • The “Type mismatch” error no longer appears.

        Issue 2: Google Maps API Warnings

        Even after fixing the chart, the following warnings persist in the console:

        Google Maps JavaScript API has been loaded directly without loading=async.
        Geocoding Service: You must use an API key to authenticate each request.
        Google Maps JavaScript API warning: NoApiKeys.
        Google Maps JavaScript API warning: InvalidKey.
        • Cause:
        • The plugin loads the Google Maps API synchronously without loading=async.
        • It attempts to use the Geocoding Service (e.g., for “Czechia” and “Türkiye”) but does not provide a valid API key.
        • Impact: These warnings do not break the chart but indicate suboptimal performance and missing configuration.

        Environment

        • WordPress Version: [6.7.2]
        • Beehive Analytics Version: 3.4.16
        • PHP Version: [8.4.5]
        • Browser: [Opera 117.0.5408.53]

        Suggestions for FixType Mismatch:

          • The plugin should validate and convert all session values (stats.countries[s][2]) to numbers before passing them to GeoChart.
          • Filter out invalid entries like “(not set)” by default to avoid breaking the chart.

            Google Maps API:

            • Update the Google Maps API loading to use loading=async for better performance.
            • Include a default API key for the Google Maps/Geocoding API or add a clear setup guide in the plugin documentation for users to provide their own key.

            Conclusion

            The “Type mismatch” error is a bug in Beehive Analytics due to improper handling of data types from Google Analytics. The additional API warnings suggest incomplete integration with Google Maps API. As a user, I shouldn’t need to manually edit plugin files to make the GeoChart work. Please address these issues in a future update.

            Let me know if you need more details or logs to reproduce this!

            Thank you,
            Mark

                Viewing 6 replies - 1 through 6 (of 6 total)
                • Plugin Support Amin – WPMU DEV Support

                  (@wpmudev-support2)

                  Hello @power2009

                  Hope you are doing well today and sorry to hear you have an issue with Beehive.

                  I ran some tests on my lab site and tried to follow the mentioned steps to replicate this issue, but I couldn’t. it might be because my test site does not have much data, so I reported this problem to our development team for further investigation.

                  We will update you here once we have further information about this problem.

                  Kind Regards
                  Amin

                  Thread Starter Marcus

                  (@power2009)

                  Cool! Thanks will wait..

                  Hi @power2009

                  As said above, this was already forwarded to our developers and we have created a bug report for that matter. There is no ETA when the fix will be implemented but future updates will contain that fix.

                  I am marking this thread as resolved, but if you have any additional questions feel free to let us know.

                  Kind Regards,
                  Kris

                  Thread Starter Marcus

                  (@power2009)

                  Hi today is resovled issues with

                  chunk-vendors.min.js?ver=3.4.16:81 Error: Type mismatch. Value 0 does not match type number in column index 1 at gvjs_yk (jsapi_compiled_default_module.js:277:264) at gvjs_M.<anonymous> (jsapi_compiled_default_module.js:294:194) at gvjs_M.<anonymous> (jsapi_compiled_default_module.js:295:73) at o.setupList (chunk-common.min.js?ver=3.4.16:1:43105) at o.onChartReady (chunk-common.min.js?ver=3.4.16:1:43611) at zn (chunk-vendors.min.js?ver=3.4.16:81:24932) at o.n (chunk-vendors.min.js?ver=3.4.16:81:14729) at zn (chunk-vendors.min.js?ver=3.4.16:81:24932) at o.$emit (chunk-vendors.min.js?ver=3.4.16:81:30959) at chunk-vendors.min.js?ver=3.4.16:191:5754

                  is resolved

                  But i see in console this issues

                  js?key=:164 Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account
                  .ml @ js?key=:164 js?key=:164 Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account .ml @ js?key=:164
                  f @ geocoder.js:4
                  c @ common.js:103
                  (anonymous) @ GeocodeService.Search?4sT%C3%BCrkiye&9sen-US&r_url=https%3A%2F%2Fsite.com%2Fwp-admin%2Fadmin.php&callback=xdc.x6u1uj&token=84669:1 js?key=:164 Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account .ml @ js?key=:164
                  f @ geocoder.js:4
                  c @ common.js:103
                  (anonymous) @ GeocodeService.Search?4sCzechia&9sen-US&r_url=https%3A%2F%2Fsite.com%2Fwp-admin%2Fadmin.php&callback=xdc.gbqnf2&token=80877:1 js?key=:164 Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account .ml @ js?key=:164
                  f @ geocoder.js:4
                  c @ common.js:103
                  (anonymous) @ GeocodeService.Search?4s(not%20set)&9sen-US&r_url=https%3A%2F%2Fsite.com%2Fwp-admin%2Fadmin.php&callback=xdc._je55co&token=88069:1
                  js?key=:164 Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account

                  Plugin Support Nebu John – WPMU DEV Support

                  (@wpmudevsupport14)

                  Hi @power2009,

                  I checked this using a test website at my end but was unable to replicate the issue. I was unable to find any other similar reports as well.

                  Can you please let us know if a conflict test was performed on your website? If not yet, can you please perform a complete conflict test to ensure there aren’t any plugins or themes conflicting and causing an issue?

                  The following documentation should help you further: https://wpmudev.com/docs/getting-started/getting-support/#conflict-test

                  If this is a live website with traffic, please create a staging website and perform the test without disrupting the live traffic. A staging website is a copy of your live website in a new directory on the same server using a separate database.

                  Please update us with the results so that we can check this further.

                  Best Regards,
                  Nebu John

                  Plugin Support Saurabh – WPMU DEV Support

                  (@wpmudev-support7)

                  Hello @power2009

                  We haven’t heard from you in a while, I’ll go and mark this thread as resolved. If you have any additional questions or require further help, please let us know!

                  Kind Regards,
                  Saurabh

                Viewing 6 replies - 1 through 6 (of 6 total)

                The topic ‘Incompatible data table: Error: Unknown address type’ is closed to new replies.