# Custom Code Workflow Get Page URL or Title

**URL:** <https://community.hubspot.com/t/custom-code-workflow-get-page-url-or-title/54251>\
**Category:** APIs & Integrations\
**Tags:** workflows\
**Created:** [April 1, 2022, 8:56am UTC](https://community.hubspot.com/t/custom-code-workflow-get-page-url-or-title/54251 "2022-04-01T08:56:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas25](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/thomas25/32/30191_2.png) [@thomas25](https://community.hubspot.com/u/thomas25)\
**Post date:** [April 1, 2022, 8:56am UTC](https://community.hubspot.com/t/custom-code-workflow-get-page-url-or-title/54251/1 "2022-04-01T08:56:34Z")

</div>

Hi all,

We use workflows to send data from hubspot to an external application whenever someone views certain landing pages. We would like to add the url and/or title of that page to the message we send to our external application. Any ideas how we can get this information within the custom code?

Kind regards,

Thomas

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [April 1, 2022, 11:08am UTC](https://community.hubspot.com/t/custom-code-workflow-get-page-url-or-title/54251/2 "2022-04-01T11:08:33Z")

</div>

Hello @thomas25,

Not a perfect solution, but if you have fewer pages, what you can do is -

- create page view based workflow to store URL in custom property
- use custom property in custom code.

Hope this help,

---

<div class="post-metadata">

**Author:** ![thomas25](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/thomas25/32/30191_2.png) [@thomas25](https://community.hubspot.com/u/thomas25)\
**Post date:** [April 1, 2022, 11:39am UTC](https://community.hubspot.com/t/custom-code-workflow-get-page-url-or-title/54251/3 "2022-04-01T11:39:44Z")

</div>

Hello @himanshurauthan,

Thanks for your response. However, we have a large number of pages, so we want to avoid having to set up a workflow for each page.

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [April 1, 2022, 11:57am UTC](https://community.hubspot.com/t/custom-code-workflow-get-page-url-or-title/54251/4 "2022-04-01T11:57:35Z")

</div>

Well, in that case, you can use the **Tracking code API** to manually track page views.
