Tracking Issues From GTM
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:
-
trackVideois not defined, this function is defined in GTM but throws the error, I don't know why
- Pinterest issue when we do integrate via GTM
Could you please take a look and give me suggestions to resolve those issues?
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:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- 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.
@taiducnguyen Did you fix it ? If you did can you share how please ?