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

The method setTrackerUrl is registered more than once in "_paq" variable #28

Closed
igortregub opened this issue Mar 22, 2018 · 2 comments
Closed

Comments

@igortregub
Copy link
Contributor

I've faced the same issue as It was described in #15

Preconditions

  1. Magento 2.2.3
  2. henhed/module-piwik 2.0.0
  3. Google Chrome

Steps to reproduce

  1. open dev console
  2. add some product to the Shopping Cart
  3. go to the checkout page
  4. see errors on the dev console

Expected result

  1. there mustn't be any errors on the dev console

Actual result

  1. there are js errors:
    piwik-js-console-error

if this issue you cannot reproduce, refresh your checkout page few times

It's happening because on the checkout page code
https://github.com/henkelund/magento2-henhed-piwik/blob/master/view/frontend/templates/piwik.phtml#L36-L49
runs in paralel with code
https://github.com/henkelund/magento2-henhed-piwik/blob/master/view/frontend/web/js/tracker.js#L298-L303
as result tracker.js tries to inject piwik.js file second time.

My PR adds checking if such script already exists on this page: #27

@henkelund
Copy link
Collaborator

Hi @igortregub!

I tried, but I couldn't reproduce this issue in my environment. But I can see how it could happen so I've merged your PR and released v2.0.1.

Thanks for your contribution

@igortregub
Copy link
Contributor Author

Thank you :)

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