About Marketing Tags
With Wix Marketing Tags, site owners can embed marketing tags in their website. The supported marketing tags are:
-
Note: The Google Ads Conversion tag was previously called Google AdWords tag.
-
Note: Both Google Universal Analytics tags and Google Analytics 4 tags are supported.
These marketing tags enable site owners to track user activity, ad conversion rates, and more.
Note: Only one marketing tag of each type is supported per Wix site.
The Marketing Tags APIs allow your app to:
- List marketing tags
- Create and update marketing tags
- Delete marketing tags
Terminology
-
Domain: Specifies which website is associated with the marketing tag.
Note: When the site owner changes the domain of a Wix site, the embedded marketing tags won’t load anymore. To update the domain use the Upsert Marketing Tag endpoint. Currently, there is no way to sign up for notifications when a site owner changes their domain name.
-
Tracking ID: Specifies which external ID is associated with the site owner. Learn more about each tracking ID in the corresponding object description. These are the supported external IDs:
Marketing Tag External ID Name ID Format Google Ads Conversion tag Conversion ID AW-123456789 Google Universal Analytics tag Analytics ID UA-12345-1 Google Analytics 4 tag Measurement ID G-12345 Yandex Metrica tag Tag number 123456789 Facebook Pixel tag Pixel ID 123456789 Google tag Tag Manager Container ID GTM-12345
Example Flow: Wix Marketing Tags
This article shares a possible use case your app could support, as well as an example flow. You're certainly not limited to this use case, but it can be a helpful jumping off point as you plan your app's implementation.
Manage Marketing Tags
Your app could help site owners manage their marketing tags after they have updated their site structure. First, you’ll list the existing tags. Then your app will update the associated domains.
Step 1: List the Embedded Marketing Tags
First, your app will call the List Marketing Tags endpoint to retrieve the marketing tags that the owners have previously embedded.
1curl -X GET \2 https://www.wixapis.com/marketing/v1/tags \3 -H 'Content-Type: application/json' \4 -H 'Authorization: <AUTH>'
In the response of the call, you can see that the associated domains are out-dated, and thus the marketing tags won’t load anymore.
1{"tags": [2 {3 "id": "994ba324-682c-4d81-abd6-84e4be44ba3c",4 "type": "GOOGLE_ADS",5 "enabled": true,6 "google_ads": {7 "domain": "old-domain.com",8 "tracking_id": "AW-672490861"9 }10 },11 {12 "id": "123ba321-678c-4d81-abd6-84e4be44ba3c",13 "type": "FACEBOOK_PIXEL",14 "enabled": true,15 "facebook_pixel": {16 "domain": "old-domain.com",17 "tracking_id": "123456789"18 }19 }20]}
Step 2: Update an Embedded Marketing Tag
Then, you’ll do a separate call of the Upsert Marketing Tag endpoint for each tag to change the associated domain. You’ll need to pass the new domain in the body of each call, as shown in the example below for the Google Ads Conversion tag.
1curl -X POST \2 https://www.wixapis.com/marketing/v1/tags \3 -H 'Content-Type: application/json' \4 -H 'Authorization: <AUTH>'5 -d '{6 "tag": {7 "enabled": true,8 "google_ads": {9 "domain": "new-domain.com",10 "tracking_id": "AW-672490861",11 }12 }13 }'
Marketing tag ID.
Marketing tag type.
Whether this tag is enabled. Defaults to true.
ONE OF:
A Google Ads Conversion tag lets site owners analyze what a visitor does after clicking on a Google ad.
A Google Analytics tag lets site owners track page views, where visitors are coming from, how long they stay, and what keywords they used to find the site. Both Google Universal Analytics Tags and Google Analytics 4 tags are supported.
A Yandex Metrica tag lets site owners build visual reports of visitor activity that helps them evaluate the performance of their marketing campaigns.
A Facebook Pixel tag allows site owners to track Facebook ad-driven visitor activity on their site.
A Google tag lets site owners implement a quick and easy tag management system that keeps 3rd party code snippets organized.
A TikTok Pixel allows site owners to share visitor events to TikTok on their site.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves marketing tags given the provided filter.
Permission Scopes
For app development, you must have one of the following permission scopes:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates or updates a marketing tag.
Permission Scopes
For app development, you must have one of the following permission scopes:This method has been replaced with DeleteMarketingTagV2, and will be removed on October 1, 2022.
Deletes a marketing tag.
Permission Scopes
For app development, you must have one of the following permission scopes:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when a marketing tag is created.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.marketing.v1.tag.
Event name. Expected created.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when a marketing tag is updated.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.marketing.v1.tag.
Event name. Expected updated.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when a marketing tag is deleted.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.marketing.v1.tag.
Event name. Expected deleted.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.