Skip to content

feat(matomo): support custom tracker urls#236

Merged
harlan-zw merged 8 commits into
nuxt:mainfrom
reslear:refactor/matomo-custom-whitelabel
Sep 4, 2024
Merged

feat(matomo): support custom tracker urls#236
harlan-zw merged 8 commits into
nuxt:mainfrom
reslear:refactor/matomo-custom-whitelabel

Conversation

@reslear
Copy link
Copy Markdown
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 ?

@vercel
Copy link
Copy Markdown
Contributor

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.

Comment thread src/runtime/registry/matomo-analytics.ts Outdated
export const MatomoAnalyticsOptions = object({
matomoUrl: string(), // site is required
siteId: string(),
matomoUrl: optional(string()),
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread docs/content/scripts/analytics/matomo-analytics.md Outdated
Comment thread docs/content/scripts/analytics/matomo-analytics.md Outdated
Comment thread docs/content/scripts/analytics/matomo-analytics.md Outdated
@harlan-zw harlan-zw changed the title refactor: matomoto custom whitelabel feat(matomo): support custom tracker urls Sep 3, 2024
@harlan-zw
Copy link
Copy Markdown
Collaborator

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

@reslear
Copy link
Copy Markdown
Contributor Author

reslear commented Sep 3, 2024

done

@harlan-zw harlan-zw merged commit 9926ad4 into nuxt:main Sep 4, 2024
zizzfizzix pushed a commit to zizzfizzix/nuxt-scripts that referenced this pull request Mar 5, 2026
Co-authored-by: Harlan Wilton <harlan@harlanzw.com>
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