-
Notifications
You must be signed in to change notification settings - Fork 61
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
Analytics broken for Hubspot, Quantcast, Chartbeat, Comscore and KISSmetrics #108
Comments
We'll try and take a look, but it sounds like it's maybe an analytics.js issue. I'd also triple check your |
There seems to be a much bigger problem than I thought. Apparently the Hubspot code doesn't get initialized at all. The thing is that for quite a few libraries there is an option "assumesPageView". If this flag is set in the plugin code, like it is for HubSpot, initialization should happen when the first page call is made. This is implemented with the "after" package. This mechanism is written in wrapInitialize and wrapPage should cause the second initialize and final initialization. But no page call is made in this case because initialization is not completed. Basically the problem is introduced with this commit: 4de2fd2 I could solve the issue for me by avoiding to use trackPageWhenReady, but this might introduce different problems. I don't know whether the changes with those on ready callbacks have been made out of another necessity? I will update the issue title accordingly as this issue is much bigger than initially thought. |
Not only the connections with these libraries get broken but everything gets stuck if you load any of these connectors and you don't do manual page tracking calls. |
@derouck There is an open issue that I believe explains the behaviour you noticed with Google Analytics and Hubspot over on segment.io's analytics.js repo ? Currently if one integration fails no .ready() is fired. A substantial rewrite might be required on our end, but we are currently investigating. We are working to resolve a few of the open bugs on the okgrow:analytics repo over the next week. Hopefully we will have a fix for you soon. |
@cfnelson That's fine, I have a fairly simple workaround by changing trackPageWhenReady like this, so for me there's no rush. var trackPageWhenReady = function () {
var _args = arguments;
analytics.ready(function () {analytics.page.apply(this, _args);});
};
var trackPage = function () {
var _args = arguments;
analytics.page.apply(this, _args);
}; With this approach, there could be some information missing, but the point is that a lot of the analytics systems want to know the first page when they are initialized. Then again they only say they are ready when they receive have tracked a page. Thus the only way forward is to start tracking pages. Otherwise, the Meteor package keeps waiting for Godot. So possible solutions for this package are:
If the segment package would allow indicating that you don't need to wait for a ready for these integrations it could work as well, but considering the age of that bug it doesn't look like anyone will pick it up soon. If you need some more information, let me know. Good luck and thanks for the package! |
@derouck Thanks for your detailed response. Out of curosity are you using FlowRouter ? I have worked on resolving a bug in our package where FlowRouter didn't log the intial page view. The fix is here #123 . I would be curious to know if this resolves your issue, though from reading your issue I suspect it is slightly different. I like your 2nd solution. I will go check what libraries are using this I will keep you upto date on any progress I make. |
Closing this issue as there has been no activity and believe it to be resolved. Please re-open if this bug comes back. |
The proposed solution is not a fix for the problem. The problem is that some (a lot) of the tracking services require data when they get initialised. The function that will track a page, will only do that once the ready event has been returned from the analytics.js package. This event will never come in this case as e.g. the Hubspot package will only initialise once there is data const trackPageWhenReady = (...args) => So if you want to solve it you need to at least have one call of analytics.page.apply before having the others inside the ready check. |
I'm encountering the same issue. If I have Google Analytics, Intercom and Mixpanel defined in settings.json it's working. |
I tried to setup analytics with Google Analytics and Hubspot through the analytics. But for some reason which I don't get it Google Analytics is not receiving any data anymore once Hubspot tracking code is also setup.
If I leave out the Hubspot code from the settings then Google is working like a charm. Has anybody had this issue as well and is there a solution or is there a way to find out what's going wrong?
Thanks for pointing me in the right direction! I will also ask the Hubspot support team to have a look at it.
The text was updated successfully, but these errors were encountered: