# Making a Smart CTA button display based on page language rather than user's browser language

**URL:** <https://community.hubspot.com/t/making-a-smart-cta-button-display-based-on-page-language-rather-than-users-browser-language/53309>\
**Category:** Lead Capture Tools\
**Created:** [March 16, 2022, 6:02pm UTC](https://community.hubspot.com/t/making-a-smart-cta-button-display-based-on-page-language-rather-than-users-browser-language/53309 "2022-03-16T18:02:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LizBW](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lizbw/32/84489_2.png) [@LizBW](https://community.hubspot.com/u/LizBW)\
**Post date:** [March 16, 2022, 6:02pm UTC](https://community.hubspot.com/t/making-a-smart-cta-button-display-based-on-page-language-rather-than-users-browser-language/53309/1 "2022-03-16T18:02:10Z")

</div>

Our website includes a header with CTA buttons for users to “Log In” or “Sign Up.” Both of these buttons are Smart CTAs, with the labels translated into all of our site languages.

By default HubSpot will show the language variations based on the user’s browser language setting, but we would like to have it display based on the Page Language setting.

I’ve been told by Support that it’s possible to custom code a module to do this, but that’s all they offered and we don’t have any devs on our team. Has anyone else dealt with this and have advice to offer?

---

<div class="post-metadata">

**Author:** ![PamCotton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pamcotton/32/47916_2.png) [@PamCotton](https://community.hubspot.com/u/PamCotton)\
**Post date:** [March 17, 2022, 9:23pm UTC](https://community.hubspot.com/t/making-a-smart-cta-button-display-based-on-page-language-rather-than-users-browser-language/53309/2 "2022-03-17T21:23:46Z")

</div>

Hello @LizBW , I would like to invite some of our top experts to share their ideas @danmoyle @dannio any recommendations to @LizBW?

Thank you,

Pam

---

<div class="post-metadata">

**Author:** ![dannio](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dannio/32/95715_2.png) [@dannio](https://community.hubspot.com/u/dannio)\
**Post date:** [March 18, 2022, 1:29am UTC](https://community.hubspot.com/t/making-a-smart-cta-button-display-based-on-page-language-rather-than-users-browser-language/53309/3 "2022-03-18T01:29:54Z")

</div>

You can obtain the current page language tag via:

`content.language.languageTag`

This will output something like ‘en’, ‘en-us’, ‘de’, ‘fr’, etc.

To make a conditional for it, you simply need to put it in an if statement like so:

```lia-code-sample
{% if content.language.languageTag == 'en' %}
 {% cta guid="{{ module.en_cta_field }}" %}
{% elif content.language.languageTag == 'fr' %}
 {% cta guid="{{ module.fr_cta_field }}" %}
{% endif %}

```

So in your module, you just need to create the corresponding CTAs for each language and make conditionals for it to show on the right pages.
