Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
webdev:api:google_shit [22/04/2019 18:35] dolo |
webdev:api:google_shit [02/09/2019 18:59] (Version actuelle) dolo [Google shits] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Google | + | ====== Google |
- | | [[http:// | + | |
* [[https:// | * [[https:// | ||
Ligne 8: | Ligne 7: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
- | * [[https://developers.google.com/ | + | * [[https://www.google.com/ |
+ | * [[https://business.google.com/ | ||
+ | ===== 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 25: | Ligne 31: | ||
})(window, | })(window, | ||
</ | </ | ||
+ | |||
+ | [[https:// | ||
===== Charger analytics en asynchrone ===== | ===== Charger analytics en asynchrone ===== | ||
Ligne 30: | Ligne 38: | ||
===== Gmaps ===== | ===== Gmaps ===== | ||
- | AIzaSyAyHMWgqFzePVvGzc8ZxGvTfKwx3CJrLJo | + | [[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. | ||
+ |