Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| webdev:api:google_shit [21/09/2017 11:40] – dolo | webdev:api:google_shit [02/09/2019 18:59] (Version actuelle) – [Google shits] dolo | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Google | + | ====== Google |
| - | | [[http:// | + | |
| * [[https:// | * [[https:// | ||
| Ligne 8: | Ligne 7: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | ===== Analytics ===== | ||
| + | [[http:// | ||
| + | |||
| + | Ajouter un accès pour un compte tiers : Admin (en bas à gauche) -> Colonne 1 : Gestion des utilisateurs | ||
| ===== Google Tag Manager ===== | ===== Google Tag Manager ===== | ||
| + | Pretty much shit, unless you're in marketing. | ||
| + | |||
| The scripts included by GTM are added before the first script in the page. So with the //plans de marquages// where we **have to** put some script before the gtm js we can't make it work. | The scripts included by GTM are added before the first script in the page. So with the //plans de marquages// where we **have to** put some script before the gtm js we can't make it work. | ||
| Ligne 24: | Ligne 31: | ||
| })(window, | })(window, | ||
| </ | </ | ||
| + | |||
| + | [[https:// | ||
| ===== Charger analytics en asynchrone ===== | ===== Charger analytics en asynchrone ===== | ||
| [[https:// | [[https:// | ||
| + | |||
| + | ===== Gmaps ===== | ||
| + | [[https:// | ||
| + | |||
| + | You need a credit card to link any google map now + if you go above the quota you have to pay them 🖕\\ | ||
| + | < | ||
| + | I'll send them an email mentioning how that's illegal and contrary to [[https:// | ||
| + | Actually you need to delete the whole [[https:// | ||
| + | |||
| + | <Code linenums> | ||
| + | <div id=" | ||
| + | |||
| + | < | ||
| + | // Initialize and add the google map | ||
| + | function initMap() | ||
| + | { | ||
| + | var adress = {lat: 45.413250, lng: -0.460379}; | ||
| + | var map = new google.maps.Map(document.getElementById(' | ||
| + | var marker = new google.maps.Marker({position: | ||
| + | } | ||
| + | </ | ||
| + | <script async defer src=" | ||
| + | </ | ||
| + | |||
| + | To get the GPS coordinates for the marker, go into google maps, right click **exactly** where you want it and click "Plus d'info sur cet endroit" | ||
| + | |||
| + | Ajouter une adresse propre (Geocoding) : [[https:// | ||
| + | |||
| + | **Les maps avec javascript sont plus chiante à mettre en place et n'ont en général aucun avantage sur celles en iframes pour des trucs simples, mais elles créent un risque d' | ||
| + | |||
| + | === Version iframes === | ||
| + | Ouvrir gmaps et une adresse, puis faire " | ||
| + | Le niveau de zoom est enregistré donc bien cadrer avant de le faire. On peut modifier la largeur dans le html généré et un width en %tage fonctionne. | ||
| + | |||
| + | |||