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

analytics function doesn't send t object #43

Closed
rstacruz opened this issue Nov 12, 2015 · 17 comments
Closed

analytics function doesn't send t object #43

rstacruz opened this issue Nov 12, 2015 · 17 comments
Labels

Comments

@rstacruz
Copy link
Contributor

Using v0.1.4, I'm getting this error:

                this.options.analytics = this.options.analytics || function(t) {
                    window._gaq && _gaq.push(["_trackPageview"]),
                    window.ga && ga("send", "pageview", {
                        page: t.url, # Uncaught TypeError: Cannot read property 'url' of undefined
                        title: t.title
                    })
                }
@MoOx
Copy link
Owner

MoOx commented Nov 12, 2015

where do you find this t thing ? I am not using this lib anymore and struggle to find something about it, sorry :/

@rstacruz
Copy link
Contributor Author

It's from here:

this.options.analytics = this.options.analytics || function(options) {
// options.backward or options.foward can be true or undefined
// by default, we do track back/foward hit
// https://productforums.google.com/forum/#!topic/analytics/WVwMDjLhXYk
if (window._gaq) {
_gaq.push(["_trackPageview"])
}
if (window.ga) {
ga("send", "pageview", {page: options.url, title: options.title})
}
}

@MoOx
Copy link
Owner

MoOx commented Nov 12, 2015

From what I can read, indeed it's not send. Not sure why I did that :(

@MoOx
Copy link
Owner

MoOx commented Nov 12, 2015

This lib wasn't tested before 0.2, but it seems 0.2 is not working and nobody wants to contribute :/

@rstacruz
Copy link
Contributor Author

any pointers on how we can fix 0.2?

@MoOx
Copy link
Owner

MoOx commented Nov 12, 2015

I "just" splited the code into small pieces, in order to facilitate testing. It seems tests are broken and I think I didn't finish a test or something like that. Should not be a big deal, but "we" just need to find what is going wrong :/

@MoOx
Copy link
Owner

MoOx commented Nov 12, 2015

Maybe you can try "npm install & npm test" and see what happens? :D

@MoOx
Copy link
Owner

MoOx commented Nov 12, 2015

I can add you as a collab if you want

@rstacruz
Copy link
Contributor Author

it breaks because one test has t.fail in it:

https://github.com/MoOx/pjax/blob/master/tests/lib/switch-selectors.js#L6

no indication as to why it's made to fail though.

edit: its introduced here at #20

@MoOx MoOx added the bug label Nov 14, 2015
@darylteo
Copy link
Collaborator

darylteo commented Jan 4, 2016

It's made to fail because there is no test written for it yet.

Switch Selectors also seems to be broken with issue #46 so I will look to fix that one and implement tests for it.

EDIT:
PR #52 patches switch-selectors.js test

@MoOx
Copy link
Owner

MoOx commented Jan 5, 2016

So is this fixed now (sorry I am lazy)?

@darylteo
Copy link
Collaborator

darylteo commented Jan 5, 2016

No I only fixed the failing test.

Not sure what the issue is in this one because the line of code referenced
doesn't seem to exist in the code base anymore.
On Tue, Jan 5, 2016 at 5:20 PM Maxime Thirouin [email protected]
wrote:

So is this fixed now (sorry I am lazy)?


Reply to this email directly or view it on GitHub
#43 (comment).

@rstacruz
Copy link
Contributor Author

rstacruz commented Jan 5, 2016

@MoOx, on a side note, may i ask why you're not using this library anymore?

for me: the alternatives are to use jquery.pjax and wiselinks, both of which rely on jQuery, which I'd prefer not to be a dependency.

@MoOx
Copy link
Owner

MoOx commented Jan 5, 2016

I now only build webapps with React (for the last two years) :)

@rstacruz
Copy link
Contributor Author

rstacruz commented Jan 5, 2016

ah, haha, right

@darylteo
Copy link
Collaborator

darylteo commented Jan 5, 2016

What about us poor legacy maintainers ...

grumbles
On Tue, Jan 5, 2016 at 5:26 PM Rico Sta. Cruz [email protected]
wrote:

ah, haha, right


Reply to this email directly or view it on GitHub
#43 (comment).

@BehindTheMath
Copy link
Collaborator

This should be fixed by #59.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants