4lejandrito / next-plausible

Simple integration for https://nextjs.org and https://plausible.io analytics
https://next-plausible.vercel.app
MIT License
603 stars 33 forks source link

Add custom properties for pageviews support #95

Closed rrozanka closed 1 year ago

rrozanka commented 1 year ago

Hello! I love the package. We are using Custom properties for pageviews and I spotted a lack of support for this. This PRs adds it. Custom properties can be then passed using the scriptProps:

<PlausibleProvider
  ...
  scriptProps={{
    'event-author': 'John Doe',
  }}
>
4lejandrito commented 1 year ago

Thanks! I'll review and merge as soon as I can (hopefully later today).

4lejandrito commented 1 year ago

Merged and published as next-plausible@3.8.0. Thanks!!

4lejandrito commented 1 year ago

Hey @rrozanka I improved support for custom pageview props in https://github.com/4lejandrito/next-plausible/commit/98a9c747f600ea267fe50d43304efcb591d0b17f. Now you can directly pass the props instead of using the boolean like this:

<PlausibleProvider
      ...
      pageviewProps={{
        customprop1: 'value',
        customprop2: 'value',
      }}
/>

This will both use the right script and set the custom event-* attributes to it.

I published it as next-plausible@3.10.0.

Please let me know your thoughts.

rrozanka commented 1 year ago

love it! nice one

sob., 15 lip 2023 o 23:08 Alejandro Tardín @.***> napisał(a):

Hey @rrozanka https://github.com/rrozanka I improved support for custom pageview props in 98a9c74 https://github.com/4lejandrito/next-plausible/commit/98a9c747f600ea267fe50d43304efcb591d0b17f. Now you can directly pass the props instead of using the boolean like this:

<PlausibleProvider ... pageviewProps={{ customprop1: 'value', customprop2: 'value', }}/>

This will both use the right script and set the custom event-* attributes to it.

I published it as @.***

Please let me know your thoughts.

— Reply to this email directly, view it on GitHub https://github.com/4lejandrito/next-plausible/pull/95#issuecomment-1636886809, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFD2OYW7WRJWYYA5NFP7TTXQMBGHANCNFSM6AAAAAAZMZJ3LU . You are receiving this because you were mentioned.Message ID: @.***>