vue-gtag icon indicating copy to clipboard operation
vue-gtag copied to clipboard

send_page_view configuration is not always honored.

Open ItsMeDelanoDev opened this issue 4 years ago • 1 comments

Description

We recently updated the library from version 1.6.2 to the most recent version. After a while our A/B environments reported a very uneven balance between original and variant. We determined this was cause by multiple send_page_view events that were fired incorrectly after the update. It was creating multiple sessions per user because of that.

While debugging we saw most of the time send_page_view was false like the configuration is set to, but we also consistently saw events with send_page_view set to true. I believe since 1.6.2 a bug has been introduced here: https://github.com/MatteoGabriele/vue-gtag/blob/8c2e39555fb867a38251ca48c6011256603df69d/src/api/pageview.js#L38

Expected behavior

When the configuration has set send_page_view to false, it should never fire events with value true for send_page_view.

Actual behavior

Events are sent with send_page_view with value true ignoring the configured false value.

Environment

[email protected]

  1. Operating system: Mac OSX
  2. Browser and version: Chrome 91

Example config

const config = {
  config: {
    id: conceptId,
    params: {
      anonymize_ip: true,
      send_page_view: false,
      custom_map: {},
      optimize_id: optimizeId
    }
  },
  includes: [
    {
      id: rollupId,
      params: {
        anonymize_ip: true,
        send_page_view: false,
        custom_map: {}
      }
    }
  ],
  onReady: new Promise(() =>
    bindEvents(Vue)
  )
}

Vue.use(VueGtag, config)

Note: We use 2 Analytics properties. One for each website, and one that combines all websites. (rollup). This might be important to the issue.

ItsMeDelanoDev avatar Jul 05 '21 15:07 ItsMeDelanoDev

I know this is an old ticket with vue2, but I have just changed the vue3 version on a [email protected] release to see if it's the cause. Do you maybe have time to check yourself as well? Very much appreciated. I could do the same for the legacy version in case you still need that one.

MatteoGabriele avatar Jul 08 '22 13:07 MatteoGabriele