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

Google Analytics to allow for websites that conduct transactions in multiple currencies #6709

Closed
XigenDominic opened this issue Sep 22, 2016 · 16 comments
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release

Comments

@XigenDominic
Copy link

Google Analytics to allow for websites that conduct transactions in multiple currencies. The ecommerce plugin allows you to specify the local currency of the transaction.

Preconditions

  1. Magento v2.1.1

Steps to reproduce

  1. Enable Google Analytics
  2. Complete transaction

Expected result

  1. Option to enable specifying local currency
  2. Local currency included in tag - https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#multicurrency

Actual result

  1. Local currency not included within tag
@TomashKhamlai
Copy link
Contributor

Let me improve your issue. I will try to guess what actions you performed. Correct me if I am wrong.

Preconditions

  1. Magento v2.1.1 is installed.
  2. A simple product is created.

Steps to reproduce

  1. Go to Stores -> Configuration -> Sales -> Google API.
  2. Change Enable from 'No' to 'Yes'.
  3. Visit this page to obtain your account number. It should look like UA-XXXXXXXXX-X. Use this guide for reference.
  4. Change the value of Account Number. Copy and paste it from the previous step.
  5. Go to Storefront as a guest.
  6. Add simple product to a cart.
  7. Proceed to checkout.
  8. Please provide URL of the page where you are expecting the result or add some additional instructions.

Expected result:

We love screenshots!

Option to enable specifying local currency
Local currency included in tag - https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#multicurrency

Actual result

Local currency not included within tag

@XigenDominic
Copy link
Author

That's it.

  1. Taken to checkout success page and in GA markup you should get

ga('set', 'currencyCode', 'EUR'); // Set tracker currency to Euros for example if order was in euros

@TomashKhamlai
Copy link
Contributor

Thank you for your submission. Unfortunately, I can not submit this issue as a bug in our internal bug tracking system. But don't give up! You have two possible options to do next.

The first one is to visit our forum where people ask for feature improvements. We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues. Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).

The second one, you can try to fix it. I will give you an idea. I just have to warn you that fixing issues is not my area of responsibility and my code snippet may be buggy, however, it worked for me on Magento v2.1.2 that I installed using composer.

How to fix this issue:

  1. Create a backup of your store.
  2. Download the code from your server using popular FTP/SFTP clients.
  3. Open in your favorite text editor ./vendor/magento/module-google-analytics/Block/Ga.php
  4. Find this line of code $result[] = "ga('require', 'ec', 'ec.js');"; it should be near line ~108.
  5. Paste after this line the next snippet:
        foreach ($collection as $order) {
            $currencyCode = $order->getBaseCurrencyCode();
        }

        $result[] = sprintf(
            "ga('set', 'currencyCode', '" . $currencyCode . "')"
        );

  1. Save it and upload back to your server.

I got this in my browser as a result:
result

@XigenDominic
Copy link
Author

That's great. Although as your editing vendor could this not get overwritten by a composer update?

@TomashKhamlai
Copy link
Contributor

@XigenDominic yes composer update will overwrite this. There are people from Magento that will review my answers and correct me if I was wrong in something. We requested this check, so please do not close this issue and wait for their response.

I voted up your idea on the forum. Thank you for your patience!

@korostii
Copy link
Contributor

korostii commented Jul 7, 2017

Hi @TomashKhamlai, I really appreciate the amount of compassion and effort you put into your job, personally. Sadly, this seems to be a rare quality among the other guys doing the issue sorting here.

The point of having this improvement added into the core is exactly in order to avoid having it yourself either to vendor (after each update) or via some kind of module-level or theme-level overrides etc.

BTW, Why does it have a needs update label? shouldn't it be marked as moved to forums instead?

@korostii
Copy link
Contributor

korostii commented Jul 7, 2017

The following is grumpy complaint at the current issue management policies in general. Please, please don't take it personally :)
As a matter of fact, feel free to ignore it completely, just like the others would.

Unfortunately, I can not submit this issue as a bug in our internal bug tracking system.

Your suggested bugfix is a clear improvement, it's fairly easy to implement, I don't think there can be any sane argument against it other than "just put it at the back of the queue", and yet "you cannot submit it".

Therefore, you let it rot on this new circle of hell called "Feature Requests and Improvements forum" for a few more months, as if that's gonna do any good. Is there at least a single suggested improvement on that forum that actually got implemented? I only see "new" and "investigating" (whatever that means).

I really don't see any benefit from having it on forums (rather than here, with labels improvement and up for grabs) if it's effectively ignored by Magento, Inc. anyway. It, sort of, kills the enthusiasm, when all the issue reports and suggestions get dismissed and overlooked for months straight. It's just sad to see.

@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-71539

@magento-team magento-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Progress: needs update labels Aug 16, 2017
@DominicWatts
Copy link
Contributor

👍

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Sep 18, 2017
@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release and removed Progress: needs update labels Sep 18, 2017
@magento-engcom-team
Copy link
Contributor

@XigenDominic, thank you for your report.
The issue is already fixed in develop branch
But we will consider to backport the fix to patch releases

@korostii
Copy link
Contributor

Hi @magento-engcom-team

Considering that develop is now corresponding to 2.3.0 version which is at least one year from release, how closing this issue makes any sense right now?

Could you please publicly share your current guidelines regarding closing acknowledged\reproduced issues and github issue flow in general?
That would be most helpful in order to understand what's going on here.

Thanks in advance.

@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Sep 29, 2017

Hi @korostii
Please note that this issue report remains open for now. It may be closed when fix is backported into 2.2.x or 2.3 is released.
We are considering to publicly announce guidelines for the GitHub issues tracking in future.
Thank you for collaboration.

@magento-engcom-team
Copy link
Contributor

@XigenDominic, thank you for your report.
The issue is already fixed in develop branch
But we will consider to backport the fix to patch releases

@XigenDominic
Copy link
Author

I created the pull request that was merged into develop. I did it on my personal account.

@korostii
Copy link
Contributor

korostii commented Oct 2, 2017

@XigenDominic
FYI if you'd like to expedite this bugfix further and have spare time for one more PR, it's encouraged to submit an extra "backport" pull request to 2.1-develop (and\or 2.2-develop, probably) with very same changes as well (now that your PR to develop is reviewed, accepted and merged).

Don't have a link handy, but this policy was publicly announced on the Magento Forums a few months back.

@magento-engcom-team
Copy link
Contributor

Hi @XigenDominic the issue has been fixed in 2.2-develop branch and will be available with release 2.2.1 soon

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Oct 11, 2017
magento-engcom-team pushed a commit that referenced this issue Mar 23, 2021
[Arrows] Fixes for 2.4 (pr135) (2.4-develop)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release
Projects
None yet
Development

No branches or pull requests

7 participants