Skip to content

Serve Addingwell by Didomi sGTM containers via Trusted Server (Addingwell Module) #740

@cmdvuy

Description

@cmdvuy

User story

Add an Addingwell integration module to proxy sGTM (Google Tag Manager) through a first-party domain. Trusted Server acts as a reverse proxy to the customer's *.adding-sst.com domain, allowing GTM tags to be served first-party and bypass ad blockers.

Implementation

Proxying

Any request to https://{{ host }}/integrations/addingwell/* must be forwarded to the configured *.adding-sst.com domain with the following rules:

  • Remove the /integrations/addingwell prefix from the path
  • Forward all query parameters in the exact same order
  • Forward all headers, especially region-related and IP-related ones

Script serving

The following snippet must be injected as high as possible in the <head> of every page:

<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://{{ host }}/integrations/addingwell/{{ integration.addingwell.gtm_js_custom_name }}?awl='+i.replace(/^GTM-/, '')+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','{{ integration.addingwell.gtm_id }}');</script>

And right after the opening <body> tag:

<noscript><iframe src="https://{{ host }}/integrations/addingwell/ns.html?id={{ integration.addingwell.gtm_id }}"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>

Configuration

[integrations.addingwell]
enabled = true

# Proxy
sst_domain = "mywebsite" # .adding-sst.com

# Script serving
inject_scripts = true
gtm_id = "GTM-XXXXXXX"
gtm_js_custom_name = "xxxxxxxx.js" # default: gtm.js

Customer setup

On the Addingwell platform, the customer must:

  1. Create a container for their GTM ID
  2. Request a *.adding-sst.com domain
  3. Grab the custom GTM filename from the CDN and set it as gtm_js_custom_name/

Metadata

Metadata

Assignees

No one assigned

    Labels

    storyA user-facing feature or capability

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions