Run script only when customer is visiting specific domain?

Hi everyone

I have 3 international domains and I would like to apply a script only to my “senkels.at” domain.

I have tried it like this but that didn’t work:

   {% if page.url contains "senkels.at" %}   

Copy

Could anyone help me with this?

Thanks

Hello, @senkels

Try like this :-

{% if shop.url contains ‘.at’ %}

Hi @IttantaTech ,

thank you for your help.

Unfortunately, this doesn’t work. Any other idea?

You can also try like this,

{% if request.host == ‘senkels.at’ %} or {% if request.host contains ‘.at’ %}

Fantastic, {% if request.host contains ‘.at’ %} did the job. thanks a lot

Just one more thing, how can I overwrite this if rule when the url contains /en ?

I am setting up different live chat widgets for each of my internation domains but all of them have english language as well so when a customer is on one of my international domains and switches to english, i would prefer to show an english widget.

Please give the exact url, so that i can give you the condition.

Sure.

There are 3 variations:

senkels.at/en

senkels.it/en

Ok ,

try this

{% if request.host == ‘senkels.at/en’ %} or {% if request.host contains ‘.at/en’ %}

I tried it like this but it doesn’t seem to work!

Please provide store access if possible so that I can check this in detail.