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

feat(matomo): support custom tracker urls #236

Merged
merged 8 commits into from
Sep 4, 2024

Conversation

reslear
Copy link
Contributor

@reslear reslear commented Sep 2, 2024

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

https://docs.cookie3.co/cookie3-docs/integrations/website-integration/cookie3-script/nuxt

uses custom matomoto white-label analytics but some enhancement:

  • uses global variables (ps. πŸ€·β€β™‚οΈ)
  • custom url in script src
  • another trackerUrl
  • not use siteId

but have a questions (ps. hi @harlan-zw):

  1. It would probably be cool to use an or construction
    matomoUrl or trackerUrl but probably optional easier to implement.

  2. I didn't modify scriptInput.src in the hope that if it is specified to the user explicitly it will overwrite the existing one, is this true ?

Copy link

vercel bot commented Sep 2, 2024

@reslear is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@@ -4,10 +4,12 @@ import { boolean, object, optional, string } from '#nuxt-scripts-validator'
import type { RegistryScriptInput } from '#nuxt-scripts'

export const MatomoAnalyticsOptions = object({
matomoUrl: string(), // site is required
siteId: string(),
matomoUrl: optional(string()),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm maybe we can deprecate this in favour if trackerUrl

Copy link
Contributor Author

@reslear reslear Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably, because in the official documentation this name is used as an environment variable - apparently as syntax sugar

var u="//{$MATOMO_URL}/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);

https://developer.matomo.org/guides/tracking-javascript-guide

I just don't know your policy on major releases so I left it for backwards compatibility. If it's not important, I'd remove it in favor of proper names and add full url's to doc.

@harlan-zw harlan-zw changed the title refactor: matomoto custom whitelabel feat(matomo): support custom tracker urls Sep 3, 2024
@harlan-zw
Copy link
Collaborator

Would you mind taking a look at the typecheck issue? then it should be good to go

@reslear
Copy link
Contributor Author

reslear commented Sep 3, 2024

done

@harlan-zw harlan-zw merged commit 9926ad4 into nuxt:main Sep 4, 2024
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants