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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悶] Google Analytics Events aren't fired #519

Open
mrxbox98 opened this issue Dec 26, 2023 · 8 comments
Open

[馃悶] Google Analytics Events aren't fired #519

mrxbox98 opened this issue Dec 26, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@mrxbox98
Copy link

Describe the bug

After setting up Google Analytics with Partytown (user analytics are working) events such as a purchase are not pushed to google analytics.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-heabie?file=src%2Froutes%2F%2Blayout.svelte

Steps to reproduce

Setup google analytics with partytown properly.
Push an event like

window.gtag("event", "purchase", {
		DATA
	});

Browser Info

All

Additional Information

When not using Partytown the events are properly pushed.

@mrxbox98 mrxbox98 added the bug Something isn't working label Dec 26, 2023
@gioboa
Copy link
Collaborator

gioboa commented Dec 26, 2023

I see, thanks for your report. Can you create a PR with a failing test for this issue? A vanilla JS one will be perfect.

@gioboa
Copy link
Collaborator

gioboa commented Dec 26, 2023

Did you use forwarding-events API ?

@mrxbox98
Copy link
Author

Did you use forwarding-events API ?

Yes

<script>
        // Forward the necessary functions to the web worker layer
        partytown = {
            forward: ['dataLayer.push', 'gtag'],
        };
    </script>

@gioboa
Copy link
Collaborator

gioboa commented Dec 26, 2023

A specific test for this issue will be awesome to solve this problem

@lknlknim
Copy link

Did you proxy the url to resolve CORS?

@mrxbox98
Copy link
Author

A specific test for this issue will be awesome to solve this problem

Not entirely sure how to write a test for it since I'm unfamiliar with this repo. https://stackblitz.com/edit/sveltejs-kit-template-default-heabie?file=src%2Froutes%2F%2Blayout.svelte should mostly replicate it.

Did you proxy the url to resolve CORS?

Everything else google analytics works so I don't think its CORS

@mrxbox98
Copy link
Author

Update: I just received an event in Google Analytics with this config so it might be something else that I have configured incorrectly. I'll give it a week to see what happens.

@gioboa
Copy link
Collaborator

gioboa commented Dec 27, 2023

GA doesn't update data in real-time
You can have more info here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants