{"id":34748608,"url":"https://github.com/stape-io/microsoft-capi-tag","last_synced_at":"2026-04-01T16:58:20.882Z","repository":{"id":310414565,"uuid":"1036470001","full_name":"stape-io/microsoft-capi-tag","owner":"stape-io","description":"Microsoft UET Conversion API Tag for Google Tag Manager Server-Side","archived":false,"fork":false,"pushed_at":"2026-02-12T16:16:33.000Z","size":136,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-27T23:42:10.916Z","etag":null,"topics":["api","gtm","gtm-custom-template","gtm-server-side","microsoft","microsoft-capi","microsoft-conversion","stape","uet","uet-capi","uet-conversion-api"],"latest_commit_sha":null,"homepage":"https://stape.io","language":"Smarty","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stape-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-12T06:00:43.000Z","updated_at":"2026-02-12T16:21:51.000Z","dependencies_parsed_at":"2026-03-27T03:02:40.300Z","dependency_job_id":null,"html_url":"https://github.com/stape-io/microsoft-capi-tag","commit_stats":null,"previous_names":["stape-io/microsoft-capi-tag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stape-io/microsoft-capi-tag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stape-io%2Fmicrosoft-capi-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stape-io%2Fmicrosoft-capi-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stape-io%2Fmicrosoft-capi-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stape-io%2Fmicrosoft-capi-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stape-io","download_url":"https://codeload.github.com/stape-io/microsoft-capi-tag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stape-io%2Fmicrosoft-capi-tag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","gtm","gtm-custom-template","gtm-server-side","microsoft","microsoft-capi","microsoft-conversion","stape","uet","uet-capi","uet-conversion-api"],"created_at":"2025-12-25T04:57:18.575Z","updated_at":"2026-04-01T16:58:20.389Z","avatar_url":"https://github.com/stape-io.png","language":"Smarty","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microsoft UET Conversion API Tag for Google Tag Manager Server-Side\n\nThe **Microsoft UET Conversion API Tag** for Google Tag Manager Server-Side allows you to send web events directly from your server to Microsoft Advertising. This server-to-server integration helps you track conversions more accurately and reliably, especially in environments with cookie restrictions.\n\nThe tag supports standard `Page Load` events as well as `Custom` events, and can automatically inherit and map events from a Google Analytics 4 data stream.\n\n## How to use the Microsoft UET Conversion API Tag\n\n1.  Add the **Microsoft UET Conversion API Tag** to your server container in GTM.\n2.  Choose your **Event Type Setup Method**: either \"Standard\" to manually configure events or \"Inherit from client\" to automatically map from GA4 events.\n3.  Enter your **UET Tag ID** (found under _Conversion Tracking → UET tag_ in Microsoft Ads) and **Authorization Token** (generated in Microsoft Ads or provided by your account manager).\n4.  Configure the **Server Event Data**, **User Data** and **Event Data** parameters. The tag can auto-map many of these fields from your event data.\n5.  Enable **Client-Side ID Sync** for improved user matching and remarketing capabilities.\n6.  Add a trigger to fire the tag (e.g., on a custom event or a GA4 client claim).\n\n## Event Type Setup\n\nYou can configure how events are sent in two ways:\n\n- **Standard**: Manually select the event type (`Page Load` or `Custom`) and specify the event name for custom conversion goals.\n- **Inherit from client**: If your server container receives GA4 events, the tag will automatically map common GA4 event names to their Microsoft UET equivalents (e.g., `page_view` → `pageLoad`, `purchase` -\u003e `purchase`, `view_item` -\u003e `product` etc.). Note that this auto-mapping is limited.\n\n## Parameters\n\n### Main Configuration\n\n- **UET Tag ID**: Your UET Tag ID from your Microsoft Ads account.\n- **Authorization Token**: The auth token generated in Microsoft Ads or provided by your account manager.\n- **Enable Client-Side ID Sync**: Strongly recommended. This allows your internal IDs to be mapped to Microsoft IDs for better user matching and remarketing via a browser pixel. It requires your Microsoft Customer ID / Manager Account ID.\n\n### Anonymous ID and Click ID Settings\n\nThe tag automatically handles the Microsoft Click ID (`msclkid`) and Anonymous ID.\n\n- It captures the `msclkid` from the URL parameter, or `uet_msclkid` cookie from server GTM, or the `_uetmsclkid` JS script cookie.\n- It sources the Anonymous ID from the `uet_vid` cookie from server GTM, or `_uetvid` JS script cookie or auto-generates one if needed.\n- You can control whether the tag sets these values as cookies and configure their expiration and domain.\n- Server GTM will save both into their own cookies and use a different name from the ones used by the JS script.\n  - Anonymous ID: `uet_vid`\n  - Click ID: `uet_msclkid`\n\n### Server Event Data Parameters\n\nThese parameters describe the server-side context in which the event occurred.\n\n- **Parameters**: Includes common parameters like `Event ID`, `Event Source URL`, `Event Time`, and `Page Title`, among others.\n- **Auto-mapping**: If enabled, the tag automatically populates these fields from the incoming event data (e.g., `Event Source URL` is mapped from `page_location`).\n- **Consent**: You can also specify if Ad Storage consent was granted for the event.\n\n### User Data Parameters\n\nThese parameters include various user identifiers to improve event match quality.\n\n**At least one user identifier is required.**\n\n- **Identifiers**: Includes common identifiers like `Anonymous ID`, `Click ID`, `Email`, `Phone Number`, and `External ID` (User ID). Other identifiers like `IP Address` and mobile device IDs (`IDFA`/`GAID`) can also be sent.\n- **Auto-mapping**: If enabled, the tag automatically populates these fields from common keys in the incoming event data (e.g., `Email` is mapped from `user_data.email_address`).\n- **Hashing**: The tag will automatically SHA-256 hash the Email, Phone Number, and External ID if they are provided in plain text.\n\n### Event Parameters\n\nThese parameters provide specific details about the user's action.\n\n- **Parameters**: Includes `Page Type`, e-commerce data (like `Revenue Value`, `Currency`, and `Items`), and custom goal values (like `Event Category` and `Event Label`), among others.\n- **Auto-mapping**: If enabled, the tag automatically populates many of these fields from a standard GA4 or e-commerce data structure in your event data (e.g., `Revenue Value` is mapped from `value`).\n- **Page Type**: Categorizes the page where the event occurred (e.g., `product`, `cart`, `purchase`). This is auto-mapped when inheriting from a GA4 client.\n\n## Intellisense for GTM Server-Side\n\nTo enable Intellisense and enhance your template development workflow, you can follow the instructions provided at the [Stape.io Google Tag Manager APIs Intellisense repository](https://github.com/stape-io/google-tag-manager-apis-intellisense). This will provide auto-completion and type-checking for the Sandboxed JS APIs within your code editor.\n\n## Useful Resources:\n\n- [Step-by-step guide on how to configure Microsoft UET Conversion API Tag](https://stape.io/blog/guide-microsoft-conversion-api-integration)\n\n## Open Source\n\nThe **Microsoft UET Conversion API Tag for GTM Server-Side** is developed and maintained by the [Stape Team](https://stape.io/) under the Apache 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstape-io%2Fmicrosoft-capi-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstape-io%2Fmicrosoft-capi-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstape-io%2Fmicrosoft-capi-tag/lists"}