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

Matomo does not work with a cloud url #279

Closed
kaboume opened this issue Sep 25, 2024 · 4 comments
Closed

Matomo does not work with a cloud url #279

kaboume opened this issue Sep 25, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@kaboume
Copy link

kaboume commented Sep 25, 2024

🐛 The bug

In my application, I have Analytics tracking working correctly however it does not work for Matomo.
Is it because I use matomo cloud?

Her is my nuxt.config.ts file :

scripts: {
    registry: {
      googleAnalytics: {
        id: "G-XXXXXXXX",
      },
      matomoAnalytics: {
        matomoUrl: "https://[mydomain].matomo.cloud/",
        siteId: "2",
      },
    },
  },

🛠️ To reproduce

no

🌈 Expected behavior

no

ℹ️ Additional context

No response

@kaboume kaboume added the bug Something isn't working label Sep 25, 2024
@harlan-zw
Copy link
Collaborator

harlan-zw commented Sep 27, 2024

Hi @kaboume, thanks for the issue.

I took a look at the Matomo implementation and doc and it did need some work. I've made it easier to configure now by assuming by default you're trying to setup a cloud instance.

export default defineNuxtConfig({
  scripts: {
    registry: {
      matomoAnalytics: {
        cloudId: 'YOUR_CLOUD_ID', // e.g. nuxt.matomo.cloud
        siteId: 2,
      }
    }
  }
})

Available in 0.9.4

@roiLeo
Copy link
Contributor

roiLeo commented Sep 27, 2024

I took a look at the Matomo implementation and doc and it did need some work.

There's still something strange going on with self-hosted matomo.

note: It's working fine on version v.0.6.2

@harlan-zw
Copy link
Collaborator

Can you provide some more details?

@roiLeo
Copy link
Contributor

roiLeo commented Sep 27, 2024

Can you provide some more details?

When I develop locally and use the current version, I get no data on my self-hosted Matomo. But when I use version v0.6.2, I get real time data.

same code

const test = useScriptMatomoAnalytics({
  matomoUrl: 'https://custom-domain.com',
  siteId: 'x',
  trackPageView: true
})

I've tried to setup inside nuxt.config but it's still not working.

edit:
With newest version these lines don't work:

test.proxy._paq.push(['setConsentGiven'])
test.proxy._paq.push(['setCookieConsentGiven'])
test.proxy._paq.push(['trackPageView'])
test.proxy._paq.push(['enableLinkTracking'])

while this work:

window._paq.push(['setConsentGiven'])
window._paq.push(['setCookieConsentGiven'])
window._paq.push(['trackPageView'])
window._paq.push(['enableLinkTracking'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants