# Accessing URL parameters in application plugin

**URL:** <https://discuss.elastic.co/t/accessing-url-parameters-in-application-plugin/222723>\
**Category:** Kibana\
**Created:** [March 9, 2020, 2:13pm UTC](https://discuss.elastic.co/t/accessing-url-parameters-in-application-plugin/222723 "2020-03-09T14:13:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bundaskifli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bundaskifli/32/64138_2.png) [@bundaskifli](https://discuss.elastic.co/u/bundaskifli)\
**Post date:** [March 9, 2020, 2:13pm UTC](https://discuss.elastic.co/t/accessing-url-parameters-in-application-plugin/222723/1 "2020-03-09T14:13:11Z")

</div>

Hi,

I have created a custom Kibana plugin of type 'app'. In this plugin, I would like to access URL parameters. Unfortunately, I was not able to find relevant documentation that would explain how this needs to be done. I noticed that \_g and \_a parameters are used, but I do not know what is the proper way to access these in my plugin code. Could you please point me to some documentation or examples that explain this?

Thank you very much!

---

<div class="post-metadata">

**Author:** ![dosant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dosant/32/64489_2.png) [@dosant](https://discuss.elastic.co/u/dosant)\
**Post date:** [March 16, 2020, 9:18am UTC](https://discuss.elastic.co/t/accessing-url-parameters-in-application-plugin/222723/2 "2020-03-16T09:18:50Z")

</div>

Hi @bundaskifli,

Are you building a "new platform" plugin?  
If so, I don't think there is a documented way to access `_a` or `_g` in "new platform" plugin in 7.6.x version. You could try to listen for browser location events yourself and get the data from query params yourself.

In 7.6.x kibana apps plugins are using this code for writing and reading from/to `_a` / `_g` query params: [link](https://github.com/elastic/kibana/tree/7.6/src/legacy/ui/public/state_management) . These are angularJs services and if your plugin is a legacy plugin and built with angularjs, then you could try to use those services.

In master and in 7.7 branch there are new state syncing utils available which would be a recommenced way to sync state with url. But it is not available in 7.6.x: [docs](https://github.com/elastic/kibana/blob/master/src/plugins/kibana_utils/docs/state_sync/README.md)

---

<div class="post-metadata">

**Author:** ![bundaskifli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bundaskifli/32/64138_2.png) [@bundaskifli](https://discuss.elastic.co/u/bundaskifli)\
**Post date:** [March 17, 2020, 3:18pm UTC](https://discuss.elastic.co/t/accessing-url-parameters-in-application-plugin/222723/3 "2020-03-17T15:18:57Z")

</div>

Hello Anton,

thanks very much for looking into this. Sorry I forgot to mention the Kibana version - I am building on 7.5.2. Unfortunately, upgrading is not an option for me.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 14, 2020, 3:19pm UTC](https://discuss.elastic.co/t/accessing-url-parameters-in-application-plugin/222723/4 "2020-04-14T15:19:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
