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

Add the domain option to the tracker trigger #3526

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iizno
Copy link

@iizno iizno commented Nov 16, 2023

Changes

Add the domain option to the tracker trigger

Below you'll find a checklist. For each item on the list, check one option and delete the other.

Tests

  • This PR does not require tests

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

@ukutaht
Copy link
Contributor

ukutaht commented Apr 23, 2024

Sorry about the delay here :/ What's the use-case for this?

@iizno
Copy link
Author

iizno commented Apr 23, 2024

Sorry about the delay here :/ What's the use-case for this?

Hello @ukutaht and thanks for you response.
On our App, we are using Plausible, one domain per customer + one domain which we add to each customer. That let us get a "domain" with the sum of all the views from all of our customer.

For exemple, this is our data-domain for three of our customers :

 <script data-domain="client1.ourapp.com,all.ourapp.com">
 <script data-domain="client2.ourapp.com,all.ourapp.com">
 <script data-domain="client3.ourapp.com,all.ourapp.com">

But we only need the "events" on the customer domain, not the "all" one.

Without this Pull Request, we are doing this :

const domains_before = script.getAttribute('data-domain');

script.setAttribute('data-domain', domains_before.replace(',all.ourapp.com', ''));
window.plausible(event_name);
script.setAttribute('data-domain', domains_before);

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