Skip to content

Instantly share code, notes, and snippets.

View parrotsoft's full-sized avatar
🎯
Focusing

Miguel Lopez Ariza parrotsoft

🎯
Focusing
View GitHub Profile
@parrotsoft
parrotsoft / _Google Analytics 4 with Hugo.md
Created June 12, 2021 23:16 — forked from zjeaton/_Google Analytics 4 with Hugo.md
Google Analytics 4 (with Measurement ID) in Hugo

Google Analytics 4 in Hugo

Blog post with slightly more detail can be found here. If you want to just get to it, read on.

I (very) recently decided to reimplement GA in my site, and found that existing implementation in Hugo was not compatible with GA4's new Measurement ID. This is an easy way to drop your Measurement ID into your site. I'm not going to go into how to sign up for GA.

This implementation requires that you create a site parameter for analytics, create a partial, and call the partial. I tweaked the names of the parameters and files so they didn't collide with the built-in hugo code.

Place the GoogleAnalyicsID (Measurement ID) in config.toml within [params].

@parrotsoft
parrotsoft / 58-markers-maps-ionic.md
Created December 23, 2019 01:00 — forked from nicobytes/58-markers-maps-ionic.md
Multiples markers ionic google maps

1 Add SDK Google Maps

<script src="https://maps.googleapis.com/maps/api/js?key=KEY"></script>

2 Create div in html and declare

declare var google;