# Mileage tracking

**URL:** <https://forum.bubble.io/t/mileage-tracking/22758>\
**Category:** Need help\
**Created:** [January 10, 2018, 1:51pm UTC](https://forum.bubble.io/t/mileage-tracking/22758 "2018-01-10T13:51:19Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![falcor](https://avatars.discourse-cdn.com/v4/letter/f/ecae2f/32.png) [@falcor](https://forum.bubble.io/u/falcor)\
**Post date:** [January 10, 2018, 1:51pm UTC](https://forum.bubble.io/t/mileage-tracking/22758/1 "2018-01-10T13:51:19Z")

</div>

Anyone know a way to track mileage driven?

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [January 10, 2018, 7:27pm UTC](https://forum.bubble.io/t/mileage-tracking/22758/2 "2018-01-10T19:27:57Z")

</div>

You can use the API Connector to do this via Google Maps ?

> **[Developer Guide  |  Distance Matrix API
       |  Google...](https://developers.google.com/maps/documentation/distance-matrix/intro)**
>
> Calculate travel distance and time between a number of points using the Google Maps API. Find out about usage limitations and how to get a key to get started.

---

<div class="post-metadata">

**Author:** ![falcor](https://avatars.discourse-cdn.com/v4/letter/f/ecae2f/32.png) [@falcor](https://forum.bubble.io/u/falcor)\
**Post date:** [January 11, 2018, 1:54am UTC](https://forum.bubble.io/t/mileage-tracking/22758/3 "2018-01-11T01:54:34Z")

</div>

Yes I was looking at this earlier looks a little overwhelming at the moment.🤔

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [January 11, 2018, 8:12am UTC](https://forum.bubble.io/t/mileage-tracking/22758/4 "2018-01-11T08:12:40Z")

</div>

Yeah, google APIs are not very friendly. And nor is the Developer Console.

Will have a look to see how possible it is.

---

<div class="post-metadata">

**Author:** ![falcor](https://avatars.discourse-cdn.com/v4/letter/f/ecae2f/32.png) [@falcor](https://forum.bubble.io/u/falcor)\
**Post date:** [January 12, 2018, 12:22am UTC](https://forum.bubble.io/t/mileage-tracking/22758/5 "2018-01-12T00:22:40Z")

</div>

Much appreciated for your time Nigel.

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [January 12, 2018, 4:13pm UTC](https://forum.bubble.io/t/mileage-tracking/22758/6 "2018-01-12T16:13:33Z")

</div>

OK, so you need to go an get yourself a Google Maps API Key. Have a search on here, I think several have posted the steps to go via the Google Developers Console.

Then all you need to do is use the API

[https://maps.googleapis.com/maps/api/distancematrix/json](https://maps.googleapis.com/maps/api/distancematrix/json)

Input your origins and destinations.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/3/3/338be7c4a6342ebc4b80277516d473ace2e7b36c.png)

Slight wrinkle in that it returns multiple “rows” so you might need to pull out the first one with “firstitem”.

{  
“destination\_addresses”: [  
“Hove, UK”  
],  
“origin\_addresses”: [  
“Brockham, UK”  
],  
“rows”: [  
{  
“elements”: [  
{  
“distance”: {  
“text”: “53.7 km”,  
“value”: 53708  
},  
“duration”: {  
“text”: “54 mins”,  
“value”: 3266  
},  
“status”: “OK”  
}  
]  
}  
],  
“status”: “OK”  
}

---

<div class="post-metadata">

**Author:** ![falcor](https://avatars.discourse-cdn.com/v4/letter/f/ecae2f/32.png) [@falcor](https://forum.bubble.io/u/falcor)\
**Post date:** [January 13, 2018, 1:09am UTC](https://forum.bubble.io/t/mileage-tracking/22758/7 "2018-01-13T01:09:17Z")

</div>

Thank you Nigel I will investigate this.👍

---

<div class="post-metadata">

**Author:** ![rkresnadi](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@rkresnadi](https://forum.bubble.io/u/rkresnadi)\
**Post date:** [February 11, 2018, 2:40am UTC](https://forum.bubble.io/t/mileage-tracking/22758/8 "2018-02-11T02:40:56Z")

</div>

Hi @NigelG. I installed the Google Map extended plugin. But I don’t know how to use it.

I have input origin and input destination on my page. but I wasn’t sure how to display the driving distance in other input field.

Below is what I have so far. On first screen I have entered origin and destination based on input fields.

 ![googlemapextended](https://us1.discourse-cdn.com/bubble/original/3X/f/b/fb95208c26bd4559bc4eccaf211c781bb61c9a15.jpeg)

Below screen is the property of the third input which should show the distance, but I am confused what to enter in the “initial content”, it is asking either destination or origin address. But I have defined it under the “distance and duration” property.

![googlemapextended2](https://us1.discourse-cdn.com/bubble/original/3X/5/c/5c4d3b01220943cbc36dce7e4e8ec0a03236d73d.jpeg)

Any example how to use this plugin. I am trying to calculate driving distance.

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 13, 2018, 10:07am UTC](https://forum.bubble.io/t/mileage-tracking/22758/9 "2018-02-13T10:07:50Z")

</div>

Hi there,

Not a plugin I have used I am afraid. Are you still having difficulty ?

---

<div class="post-metadata">

**Author:** ![rkresnadi](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@rkresnadi](https://forum.bubble.io/u/rkresnadi)\
**Post date:** [February 16, 2018, 3:57am UTC](https://forum.bubble.io/t/mileage-tracking/22758/10 "2018-02-16T03:57:08Z")

</div>

Sorry, I thought you were using that plugin.

But yeah, I haven’t figured out how to do it yet. Which plugin are you using?

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [February 18, 2018, 4:43pm UTC](https://forum.bubble.io/t/mileage-tracking/22758/11 "2018-02-18T16:43:08Z")

</div>

No, not that one.

I have done mileage, but built my own Google API call in the API connector.

To do it with the plugin …

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/e/0/e0129d372834848a3067eab5506d7442fbba795d.png)

You get the same thing with the Google API, it gives you multiple rows back. But you could use firstitem I guess.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/c/8/c899b241eb123b0b32fbbce1008bb2971bc3b60b.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [March 21, 2018, 1:51pm UTC](https://forum.bubble.io/t/mileage-tracking/22758/12 "2018-03-21T13:51:31Z")

</div>

This topic was automatically closed after 70 days. New replies are no longer allowed.
