BuilderIO / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
https://partytown.builder.io
MIT License
13.01k stars 432 forks source link

Tracking Issues From GTM #181

Open taiducnguyen opened 2 years ago

taiducnguyen commented 2 years ago

Hi team,

I'm trying to integrate with GTM and we found some issues as below: Here is my configuration:

<script>
    var partytown = {
        lib: '/ui/build/partytown/',
        forward: [
            'dataLayer.push',
            'fbq'
        ],
        resolveUrl(url, location) {
            if (
                url.hostname.includes('google-analytics') ||
                url.hostname.includes('connect.facebook.net')
            ) {
                const proxyUrl = new URL(self.location.origin + "/api/proxy-api/getexternal");
                console.log('proxyUrl', proxyUrl);
                console.log('url.href', url.href);
                console.log('url', url);

                proxyUrl.searchParams.append("url", url.href);
                return proxyUrl;
            }
            return url;
        },
        debug: true,
    };
</script>

<script src="~/ui/build/partytown/partytown.js"></script>

There are some issues I found:

Could you please take a look and give me suggestions to resolve those issues?

steve8708 commented 2 years ago

hey @taiducnguyen - we've just created an issue template, could you update your issue here to provide all the information the template asks for? it'll help us look into your issue https://github.com/BuilderIO/partytown/issues/new?assignees=&labels=&template=bug_report.md&title=

pasting below to make things easier:


Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Reproduction link Please include a link to a Stackblitz or Codesandbox reproducing the issue. We will need to see the issue reproduced with hand-written code - we can't debug giant minified third party scripts directly. If you do not include a clean and simple reproduction of your issue, we won't be able to look into it until you do.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

ilkerunal commented 1 year ago

@taiducnguyen Did you fix it ? If you did can you share how please ?