flpvsk / gatsby-plugin-gtag

Gatsby plugin to add Google Analytics gtag.js (replacement for analytics.js) to a site.
MIT License
28 stars 12 forks source link

OutboundLink with target _blank Redirects in Current Window #12

Closed pcoleman-pixafy closed 5 years ago

pcoleman-pixafy commented 5 years ago

https://github.com/flpvsk/gatsby-plugin-gtag/blob/57653fd6cd65612a84712bf0e2127e04cc2b3e53/src/index.js#L37-L39

The issue seems to be with the above line, when using OutboundLink with a target="_blank" prop, there are redirect checks in other parts of the code, but not here. If you would wrap line 38 in the same if statement as on line 42 it should fix the issue.

vitormv commented 5 years ago

I just opened a MR fixing this issue

flpvsk commented 5 years ago

Published as v1.0.11 Thanks for the patch, @vitormv!