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
-
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
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.
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.
First, your app will call the List Marketing Tags endpoint to retrieve the marketing tags that the owners have previously embedded.
Copy Code
curl -X GET \https://www.wixapis.com/marketing/v1/tags \-H 'Content-Type: application/json' \-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.
Copy Code
{"tags": [{"id": "994ba324-682c-4d81-abd6-84e4be44ba3c","type": "GOOGLE_ADS","enabled": true,"google_ads": {"domain": "old-domain.com","tracking_id": "AW-672490861"}},{"id": "123ba321-678c-4d81-abd6-84e4be44ba3c","type": "FACEBOOK_PIXEL","enabled": true,"facebook_pixel": {"domain": "old-domain.com","tracking_id": "123456789"}}]}
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.
Copy Code
curl -X POST \https://www.wixapis.com/marketing/v1/tags \-H 'Content-Type: application/json' \-H 'Authorization: <AUTH>'-d '{"tag": {"enabled": true,"google_ads": {"domain": "new-domain.com","tracking_id": "AW-672490861",}}}'
ONE OF:
Creates or updates a marketing tag.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Deletes a marketing tag.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Triggered when a marketing tag is created.
Event Body
Triggered when a marketing tag is updated.
Event Body
Triggered when a marketing tag is deleted.