Skip to content

Commit

Permalink
This commit fixes #6902 (#7020)
Browse files Browse the repository at this point in the history
  • Loading branch information
yom-ko authored and m-allanson committed Aug 6, 2018
1 parent d3a0ae0 commit ed191ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/gatsby-plugin-google-analytics/src/gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ exports.onRenderBody = (
excludeGAPaths.length
? `window.excludeGAPaths=[${excludeGAPaths.join(`,`)}];`
: ``
}
}
${
typeof pluginOptions.anonymize !== `undefined`
((typeof pluginOptions.anonymize !== `undefined`) && (pluginOptions.anonymize === true))
? `function gaOptout(){document.cookie=disableStr+'=true; expires=Thu, 31 Dec 2099 23:59:59 UTC;path=/',window[disableStr]=!0}var gaProperty='${
pluginOptions.trackingId
}',disableStr='ga-disable-'+gaProperty;document.cookie.indexOf(disableStr+'=true')>-1&&(window[disableStr]=!0);`
Expand All @@ -47,8 +47,8 @@ exports.onRenderBody = (
if (typeof ga === "function") {
ga('create', '${pluginOptions.trackingId}', 'auto');
${
typeof pluginOptions.anonymize !== `undefined`
? `ga('set', 'anonymizeIp', 1);`
((typeof pluginOptions.anonymize !== `undefined`) && (pluginOptions.anonymize === true))
? `ga('set', 'anonymizeIp', true);`
: ``
}}
`,
Expand Down

0 comments on commit ed191ba

Please sign in to comment.