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

JS reload causes issues #14

Open
svleeuwen opened this issue May 23, 2014 · 1 comment
Open

JS reload causes issues #14

svleeuwen opened this issue May 23, 2014 · 1 comment

Comments

@svleeuwen
Copy link
Contributor

The document.reload call causes some issues.

  1. Referrer information isn't interpreted correctly in Google Analytics. (organic traffic is measured as direct)
  2. Google PageSpeed Insights raises a 'too many redirects' error.

I've fixed this in my fork by removing the reload call and using a default 'type' if width is None. But this feels a bit like a workaround. And because I use 'desktop' as default type it will load desktop images on mobile devices on the first load.

Maybe you have some ideas?

@svleeuwen svleeuwen changed the title Reload JS reload causes issues May 23, 2014
@mlavin
Copy link
Owner

mlavin commented May 23, 2014

Honestly GA problems were something that I hadn't considered when making this but that would obviously be a problem. Letting the first page load go through without the information is a reasonable work-around if you understand the implications. As you noted the first page load will potentially show for the wrong type. Given the importance of first impressions that's what lead me to reload the page in the first place.

I suppose something could be done to only redirect if the width would map to a non-default size but that would still cause some problems and it might be difficult to pass that information (i.e what is the default) to the JS code.

No brilliant solution comes to mind but it's an interesting problem to address.

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

No branches or pull requests

2 participants