Skip to content

Commit

Permalink
fix: attempt to fix tracking snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
lutangar committed Jan 30, 2024
1 parent afc76a2 commit 2469d24
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ COPY --from=builder /build/dist/apps/$COPY_PATH/* ./dist

WORKDIR /app/dist
RUN npm install --force
RUN npm install @faker-js/faker

# Start the server using the production build
CMD [ "node", "main.js" ]
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/.env.default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ grep -v '^#' .env.default | while IFS= read -r line; do
echo "$value"
if [ -z "$value" ]
then
echo "Environment variable $name is empty. Skipping default value substition..."
echo "Environment variable $name is empty. Skipping default value substitution..."
else
echo "Substituing $name default value '$default_value' with environment value '$value' in $SED_GLOB"
echo "Substituting $name default value '$default_value' with environment value '$value' in $SED_GLOB"
echo "sed -i \"s#$default_value#$value#g\" $SED_GLOB"
fi
done
2 changes: 1 addition & 1 deletion apps/frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ REACT_APP_MAPBOX_ACCESS_TOKEN="token"
REACT_APP_DEFAULT_LOCALE='fr'
REACT_APP_API_BASE_URL=http://localhost:3333/api
REACT_APP_CONTACT_EMAIL=me@frontend.example.org
REACT_APP_MATOMO_TRACKER_URL=https://matomo.example.org/
REACT_APP_MATOMO_TRACKER_URL=//matomo.example.org/
REACT_APP_MATOMO_SITE_ID=1234
23 changes: 8 additions & 15 deletions apps/frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,16 @@
To create a production bundle, use `npm run build` or `yarn build`.
-->
<!-- Matomo -->
<script>
var _paq = (window._paq = window._paq || []);
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
// var u = 'https://statweb.grandlyon.com/';
var u = '%REACT_APP_MATOMO_TRACKER_URL%';
_paq.push(['setTrackerUrl', u + 'matomo.php']);
// _paq.push(['setSiteId', '172']);
_paq.push(['setSiteId', '%REACT_APP_MATOMO_SITE_ID%']);
var d = document,
g = d.createElement('script'),
s = d.getElementsByTagName('script')[0];
g.async = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g, s);
(function() {
var u="%REACT_APP_MATOMO_TRACKER_URL%";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', %REACT_APP_MATOMO_SITE_ID%]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
Expand Down

0 comments on commit 2469d24

Please sign in to comment.