How can we help?

How to use Own CDN on Stape

Ivanna
Ivanna

The option of using Own CDN helps, for example, to server your server GTM within the same IP as your website which prevents the latest WebKit version from decreasing first-party cookie lifetime

 

Below is an example of how you can configure Own CDN with CloudFlare. 

Please note that you can use any other DNS provider, and Cloudflare here is just one example.


1. Go to your stape container setting and select Own CDN.

Screenshot 2024-04-23 at 15.33.32.png

 

2. Go to CloudFlare and configure CNAME record for the tagging server URL. Please make sure that Proxied is enabled. The setting should look like in the screenshot below. 

Screenshot 2024-04-23 at 15.34.36.png

 

3. Go to the Rules -> Configuration Rules - create a new rule

  • Specify any name you like for the rule
  • Select ‘Custom filter expression’ 
    • Field: hostname
    • Operator: contains
    • Value: specify your sGTM subdomain. In our example is ‘gtm.stape.tools’

Screenshot 2024-05-29 at 12.15.29.png

Scroll down on this page and find the ‘SSL’ feature. Activate it with ‘Full’ option.

2.png

4. Go to the Rules -> Transform Rules -> Modify Request Header - create a new rule

  • Specify any name you like for the rule
  • Select ‘Custom filter expression’ 
    • Field: hostname
    • Operator: contains
    • Value: specify your sGTM subdomain, in our example, it is ‘gtm.stape.tools’

Screenshot 2024-05-29 at 12.18.54.png

In the modify headers section, specify:

  • Type: Set static
  • Header name: X-From-Cdn
  • Value: cf-stape4.png

Deploy changes

5. Go to the Caching -> Cache Rules - create a new rule

 

  • Specify any name you like for the rule
  • Select ‘Custom filter expression’ 
    • Field: hostname
    • Operator: contains
    • Value: specify your sGTM subdomain. In our example, it is ‘gtm.stape.tools’

 

Cache eligibility: Bypass cache

Screenshot 2024-05-29 at 12.25.16.png

Deploy changes.

 

That's it, now all your requests to and from sGTM will be proxied through Cloudflare.

 

*If you are using a Web Application Firewall please make sure that it will not block these requests.

Was this article helpful?

6 out of 9 found this helpful

Have more questions? Submit a request

Comments

2 comments

  • Comment author
    Cécile James Merlin

    Good morning,

    I'm starting with Stape :)
    I find your explanation complicated.
    In Cloudflare your screenshot is not clear to me.

    AT STAPE
    Custom domain
    Domain Name: https://NAME.stape.io
    Own Cdn

    AT CLOUDFLARE
    CNAME > ss = NAME ? > .= ? stape.io > proxied true > auto TTL

    I am taking an example to show you what is difficult for me to understand in your explanation and how I configured this hazardous deduction, so can you tell me if it is correct?

    AT STAPE
    Domain Name: Https://gtm.mysite.com
    Own Cdn

    AT CLOUDFLARE
    DNS
    CNAME > gtm > mysite.com > proxied true > auto TTL

    PAGE RULE
    URL (required)
    https://mysite.com/metrics/*

    Currently and for 2 days in my container, my personalized domain is still being verified
    Kind regards
    CM

    0
  • Comment author
    Dmytro

    Hi,

    When creating a CNAME record in Target/Content, you need to specify the value specified in your container on Stape.


    In your case, the record should look like this:

    Type: CNAME
    Name: gtm
    Target/Content: eu.stape.io
    TTL: Auto
    Proxy status: true

    1

Please sign in to leave a comment.