# GatsbyJS - setPath

**URL:** <https://community.hubspot.com/t/gatsbyjs-setpath/11677>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [October 15, 2018, 8:11am UTC](https://community.hubspot.com/t/gatsbyjs-setpath/11677 "2018-10-15T08:11:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobinSwapcard](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/robinswapcard/32/26012_2.png) [@RobinSwapcard](https://community.hubspot.com/u/RobinSwapcard)\
**Post date:** [October 15, 2018, 8:11am UTC](https://community.hubspot.com/t/gatsbyjs-setpath/11677/1 "2018-10-15T08:11:18Z")

</div>

Hi there,

For my showcase I’m using GatsbyJS.

I used the function setPath to update user page view as the page changement is handled by React.

Question: On page update, should I see in Network Google Console a new line ? ([https://js.hs-analytics.net/analytics/1539590700000/3004554.js](https://js.hs-analytics.net/analytics/1539590700000/3004554.js)) I see it only once when I load the page.

How to be sure that my installation of Hubspot is well installed ?

---

<div class="post-metadata">

**Author:** ![cbarley](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cbarley/32/82559_2.png) [@cbarley](https://community.hubspot.com/u/cbarley)\
**Post date:** [October 15, 2018, 8:24pm UTC](https://community.hubspot.com/t/gatsbyjs-setpath/11677/2 "2018-10-15T20:24:03Z")

</div>

Hi [@Robin\_Herzog](https://community.hubspot.com/u/robin_herzog) This method should do the trick: [https://developers.hubspot.com/docs/methods/tracking\_code\_api/set\_page\_path](https://developers.hubspot.com/docs/methods/tracking_code_api/set_page_path) as it looks like you have so far, though that path should just update the page path - it won’t inherently track the page view. You have to then call this function: [https://developers.hubspot.com/docs/methods/tracking\_code\_api/track\_page\_view](https://developers.hubspot.com/docs/methods/tracking_code_api/track_page_view). Per the `Set Page Path` document:

_“After using this function to update the path, you will need to call the [trackPageView function](https://developers.hubspot.com/docs/methods/tracking_code_api/track_page_view) to track the view of the current page.”_

---

<div class="post-metadata">

**Author:** ![RobinSwapcard](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/robinswapcard/32/26012_2.png) [@RobinSwapcard](https://community.hubspot.com/u/RobinSwapcard)\
**Post date:** [October 30, 2018, 9:04am UTC](https://community.hubspot.com/t/gatsbyjs-setpath/11677/3 "2018-10-30T09:04:15Z")

</div>

Hi,

Looks page are well tracked but the meta title is not taken into account.

[

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/1/7/17f6a6186c170312dc8a96127e11909dc63ccd90.png)

Capture d'écran 2018-10-30 10.02.29.png1480x736 95.2 KB

]([https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/4/47d2dbcfa486b529f05d95f20e9c7031db02b206.png](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/4/47d2dbcfa486b529f05d95f20e9c7031db02b206.png))

My visitors went on different pages but the meta title stay the same. Not on every page, but for the first one yes.

Robin

---

<div class="post-metadata">

**Author:** ![RobinSwapcard](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/robinswapcard/32/26012_2.png) [@RobinSwapcard](https://community.hubspot.com/u/RobinSwapcard)\
**Post date:** [October 30, 2018, 9:09am UTC](https://community.hubspot.com/t/gatsbyjs-setpath/11677/4 "2018-10-30T09:09:25Z")

</div>

I did a console.log(document.title) before and after the trackPageView. The correct title is shown.
