Twitter Website Tag Overview

Conversion tracking lets you understand your return on advertising spend by tracking the actions users take after viewing or engaging with your Twitter Ads campaigns. By implementing the Twitter website tag on your site, you can track visits and other actions on your website that were driven by users’ exposure to, and engagement with, your Promoted Tweets or Twitter Audience Platform display creatives.

Set up the website tag on your site to analyze, compare, and optimize your campaigns with the website visits or website conversions objectives. For a better understanding of the ROI of your Promoted Tweets campaigns, including the total revenue (or total conversion value) your campaign generated, and total number of items purchased, you can pass transaction values from your website into your Twitter Ads analytics.

If you have run direct response campaigns on other ad platforms, you might be familiar with the basics of how Twitter’s website tag functions. To start measuring conversions, it’s important to add a snippet of Twitter code to every page on your website that you want to track, particularly pages that correspond to the conversion events. We call this code snippet a website tag. On other ad platforms, the website tag is commonly referred to as a "tracking script" or a "pixel".

Twitter’s conversion tracking for websites includes powerful capabilities to let you track conversions cross-device. For example, website conversions from users who view your Promoted Tweet on their mobile device, then convert on their home computer, can be attributed to your campaign performance. Advertisers that completely integrate the Twitter Universal Website Tag across all their site pages give Twitter more touch points with their site visitors and increase the likelihood that Twitter can report accurate cross-device conversions.

 

Overview

  • Setup
    Arrow down icon

    The first step in setting up your campaign with Twitter Ads is to identify the conversion events you would like to track. A conversion event could be a home page visit, a purchase, a white paper download, an email newsletter signup, etc.

    Visit the conversion tracking section of Twitter Ads, accessible via the "Tools" menu, to generate a Universal Website Tag code snippet for your website. After you place the code snippet on the pages where your conversions occur and define your conversion events, website conversions will appear within your Twitter Ads campaign analytics for campaigns with the website visits and website conversions objectives.


    Did we help answer your question?

    The maximum length for this field is 5000 characters.
    Success
    Thanks for submitting feedback on this article!
    Error
    Problem sending form.
  • Conversion Types Explained
    Arrow down icon

    Choose the type of conversion you’d like to track with this tag. Your Twitter Ads dashboard reports on conversions by conversion type. Here are the types:

    Site visit: User visits your site

    Purchase: User completes a purchase of a product or service on your site

    Download: User downloads a file, such as a white paper or software package, from your site

    Sign up: User signs up for your service, newsletter, or email communication

    Custom: This is a catch-all category for a custom action that does not fall into one of the categories above

     

     


    Did we help answer your question?

    The maximum length for this field is 5000 characters.
    Success
    Thanks for submitting feedback on this article!
    Error
    Problem sending form.
  • Create a conversion event
    Arrow down icon

    Within the event details screen, you should name each conversion event you create by giving it a descriptive name. You can track a general conversion event (“Newsletter Sign Up,” for example) and specify the URLs for each confirmation page related to that event. Alternatively, you may wish to track a more specific conversion event (“Back to School sale purchases”) by only specifying the exact URL of the confirmation page for that conversion event.

    • URL Matching
      • Generally, we recommend using the ‘URL Contains’ match rule over the ‘Exact URL’ match rule. Selecting "Exact URL" will trigger a conversion event whenever a user visits a page with a Twitter Universal Website Tag that matches your rules. "Exact URL" matching is case sensitive and looks to match the URL exactly as given, including URL query string parameters and the protocol of the page (e.g, 'http' and 'https'). URL query string parameters can vary between users and site navigation paths; therefore we recommend that you only select "Exact URL" matching for specific use cases.

    We recommend using the "Universal Website Tag" as opposed to the "Single Event Tag". The "Universal Website Tag" simplifies the tagging process so you can deploy a single tag across all user actions on your site, with a simple parameter passed into the tag to signify the type of conversion event you would like to track. Previously, you might need several "Single Event Tags" in order to collect data for various audiences.

     

     


    Did we help answer your question?

    The maximum length for this field is 5000 characters.
    Success
    Thanks for submitting feedback on this article!
    Error
    Problem sending form.
  • Copy and paste your website tag into your site
    Arrow down icon

    After you generate the code snippet for your website tag, you need to put the code snippet on the page you would like to track. The code snippet should be pasted just before the closing HTML </body> or </head> tag of your web page, or inside a container tag or tag management system. You might need a developer or technical resource to help you implement it.


    Did we help answer your question?

    The maximum length for this field is 5000 characters.
    Success
    Thanks for submitting feedback on this article!
    Error
    Problem sending form.
  • How do I check to see if my tracking pixel is working?
    Arrow down icon

    To check that your website tag is set up correctly, return to the conversion tracking page in your Twitter Ads account after a few hours. The status for your website tag should have changed from “unverified” to “tracking”. You can also verify that the website tag is firing on your website with the Twitter Pixel Helper extension for the Chrome web browser, which is available at no charge in the Chrome Web Store. It may take up to 24 hours before the Twitter Ads UI shows a “Tracking” status. The Twitter Pixel Helper will detect the tag more quickly.


    Did we help answer your question?

    The maximum length for this field is 5000 characters.
    Success
    Thanks for submitting feedback on this article!
    Error
    Problem sending form.
  • Install the Twitter pixel base code using Google Tag Manager
    Arrow down icon
    • Log into your Google Tag Manager account: https://tagmanager.google.com/#/home
    • Select the appropriate Workspace associated with your website’s container.
    • Select “Tags” from the left-hand navigation menu and click “Add A Tag”.
    • When prompted, select “Choose a tag type to begin setup…”. From the right-hand pane, select “Twitter Website Tag” from the list.

    • Give your tag a title. It will default to “Untitled Tag”.
    • Within the Twitter Ads UI (ads.twitter.com), log into your Ads account and click "Tools" > "Conversion tracking".
    • If prompted, generate your new Universal Website Tag. Otherwise, click “View code and installation instructions”.
    • Within the code snippet, copy your pixel ID from the line that resembles “twq(‘init’, ‘twitter_pixel_id’);”. In the screenshot below, the pixel ID is ‘nuqtg’. Your pixel ID will be unique to your Ads account.
    • Within the Google Tag Manager form, paste your pixel ID in the Twitter Pixel ID field.
    • Select the appropriate Twitter tag event for the action you wish to track on your website.
    • Add the necessary parameters for the tag event. Assign static values or dynamic values from your data layer for each tag parameter. For example, the “Purchase” tag event will typically include “value” and “currency” parameters:

    • For more information about tag events and required parameters, see the Twitter Help Center.

    • Add the necessary triggers to have the tag event load on a specific set of web pages. For example, the “Purchase” event typically fires on order confirmation pages, so our example tag trigger only loads the tag when “purchase” is within the page URL:

    • Your triggers will be specific to your site configuration and URL structure.
    • Save your changes to the tag configuration.

    • When you are done adding the necessary tags to your Google Tag Manager configuration, click “Publish” to push the tags live.

    Did we help answer your question?

    The maximum length for this field is 5000 characters.
    Success
    Thanks for submitting feedback on this article!
    Error
    Problem sending form.
  • Install the Twitter pixel base code using Tealium
    Arrow down icon

    If you use Tealium to manage marketing tags for your website, then you can easily install the Twitter pixel by following the below steps.

    From your Tealium dashboard, click the “Tags” tab and then click “+ Add Tag”.

    Search for the Twitter Universal Website Tag, then click “+ Add”.

    • Give your tag a title. It will default to “Twitter Universal Website Tag”.

    • Within the Twitter Ads UI (ads.twitter.com), log into your Ads account and click "Tools" > "Conversion tracking".
    • If prompted, generate your new Universal Website Tag. Otherwise, click “View code and installation instructions”.
    • Within the code snippet, copy your pixel ID from the line that resembles “twq(‘init’, ‘twitter_pixel_id’);”. In the screenshot below, the pixel ID is ‘nuqtg’. Your pixel ID will be unique to your Twitter Ads account.
    • Within the Tealium UI, paste your pixel ID in the Twitter Pixel ID field.
    • Set your “Load Rules” to appropriately load the tag on the relevant pages of your website. Load Rules determine when and where to load an instance of this tag on your site. The "Load on All Pages" rule is the default. To load the tag on a specific page, create relevant conditions to apply to the configuration.
    • Set your “Data Mappings”. Mapping is the process of sending data from a data source, in your Data Layer, to the matching destination variable in the Twitter Universal Website Tag.

    • Below is an example of a set of data mappings for this tag. Your Data Source names do not need to match the example. This example assumes a fully configured E-Commerce extension.
    • Click “Publish” in the Tealium UI to publish the newly created tags to your development, staging, or production environments.
    • Note: If you have any questions please see Tealium’s detailed documentation here: https://community.tealiumiq.com/t5/Tags/Twitter-Universal-Website-Tag-Basic-Configuration-and-Data/ta-p/15214
      • Within the Ads UI, you will also see the conversion events linked to the pixel event switch to a status of “TRACKING”:

    It may take up to 24 hours before the Ads UI shows a “TRACKING” status. The Twitter Pixel Helper will detect the tag more immediately.

    If you use Ensighten’s TagMan interface to manage marketing tags for your website, then you can easily install the Twitter pixel by following these steps.


    Did we help answer your question?

    The maximum length for this field is 5000 characters.
    Success
    Thanks for submitting feedback on this article!
    Error
    Problem sending form.
  • Install the Twitter pixel base code using Ensighten
    Arrow down icon
    • From your TagMan dashboard, search for the “Twitter Universal Website Tag” within the TagMan library:
    • Give your tag a title. It will default to “Twitter Website Event Tag”.

    • Within the Twitter Ads UI (ads.twitter.com), log into your Ads account and click "Tools" > "Conversion tracking".

    • If prompted, generate your new Universal Website Tag. Otherwise, click “View code and installation instructions”.
    • Within the code snippet, copy your pixel ID from the line that resembles “twq(‘init’, ‘twitter_pixel_id’);”. In the screenshot below, the pixel ID is ‘nuqtg’. Your pixel ID will be unique to your Ads account.

    • Within the TagMan UI, paste your pixel ID in the Twitter Website Tag ID field.
    • Set the “Tag Event Type” field to one of the eleven Twitter tag event types. Example: PageView, ViewContent, Search, AddToCart, AddToWishlist", InitiateCheckout, AddPaymentInfo, Purchase, Signup, CompleteRegistration, or Download.

    • Depending on your selected “Tag Event Type”, configure the necessary parameters for the event.
    • Each Twitter tag event has a set of required and optional parameters. For example, the “ViewContent” event requires the “content_ids” and “content_type” parameters. For more information, please visit the Twitter Help Center.
    • Configure the tag firing conditions for the tag event type.
    • Save the configuration and repeat the above steps for each tag event you wish to fire on your website.
    • Publish the newly created tags to your development, staging, or production environments.

    Did we help answer your question?

    The maximum length for this field is 5000 characters.
    Success
    Thanks for submitting feedback on this article!
    Error
    Problem sending form.
  • Troubleshooting/FAQs
    Arrow down icon

    What's the difference between Single Event Tags and the Universal Website Tag?

    The Universal Website Tag (recommended option) simplifies the tagging process so you can deploy a single tag across all user actions on your site. Previously, you might have needed to implement several Single Event Tags in order to collect data for various audiences. This introduced complexity as some advertisers would have to track and implement different copies of the Twitter Pixel with individual tag IDs. The Twitter Single Event Tags are still supported and available to advertisers who cannot configure conversion events based on URL-matching rules due to their site structure and web page functionality.

    Is the Single Event Tag going away?

    No, the Single Event Tag will remain functional, however we highly encourage advertisers to utilize Universal Website Tag for most types of tracking.

    What are some instances where the Single Event Tag is preferred over the Universal Website Tag?

    Although we recommend using the Universal Website Tag whenever possible, there are some scenarios where you might want to use the Single Event Tag, such as when the event being tracked does not change the page URL. For instance, if your site has a checkout flow consisting of 4 steps (add to cart, add payment information, confirm order, order confirmation) and you would like to track the user dropoff between steps so you can deliver highly customized ads, using a series of Single Event Tags that would selectively fire in between each step would be the ideal way to do this.

    I use a 3rd party e-commerce platform like Shopify for my website. How do I install the Twitter Universal Website Tag?

    Implementing website tags in a site builder platform

    If you use a common website building platform such as Squarespace or Wix, implementing the Universal Website Tag is simple as long as the platform allows you to edit the HTML of your website. Here are some platform specific examples:

    • Squarespace
      • Login to your Squarespace account, click “Settings” and then “Advanced”
      • Click "Code Injection"
      • In the Header box, paste the contents of the Twitter Universal Website Tag
      • Click "Save"
      • Squarespace also allows you to add certain types of tags (such as conversion events) to specific pages (such as Order Confirmation). To do this, go to the page you’d like to edit, click "Settings" and then "Advanced"
    • GoDaddy Website Builder
      • Login to your account and click "Edit Site"
      • Under "Site Settings", select "Site-wide Code"
      • Insert your Twitter Universal Website Tag between the <head> or <body> tags
      • Click "Save" then "Publish"
    • WordPress

     

    What sort of customizations can I make to the Twitter Universal Website Tag to capture more data?

    Providing accurate and complete information within the Twitter Universal Website Tag will help ensure accurate reporting for your campaigns. For each tag event within the Twitter Universal Website Tag, there is a set of required and optional parameters. Additional information can be sent within the set of optional parameters. Data from these optional parameters may be leveraged by future Twitter advertising products. For each tag event within the Twitter Universal Website Tag, there is a set of required and optional parameters. Additional information can be sent within the set of optional parameters.

    What is “Post-engagement attribution window” and “Post-view attribution window”?

    When users are served your ad on Twitter or the Twitter Audience Platform, their impression and engagement with the ad is tracked. If the user completes a visit or another type of conversion on your website during the attribution window(s) you specified during website tag setup, Twitter recognizes that the user has previously interacted with your Twitter Ad. The tag then “fires,” or sends a notification to Twitter’s servers so that the conversion can be attributed to the ad which generated conversion. “Post-engagement” refers to a website visit or conversion after engaging with your ad, and “post-view” refers to a website visit or conversion after viewing your ad (without having engaged with it).

    By default, "Post engagement attribution window" (often referred to as "Click Conversion Window") is set to 30 days, whereas "Post-view attribution window" (often referred to as "View-through conversion Window") is set to 1 day. For additional information and best practices, please refer to https://dev.twitter.com/ads/campaigns/conversion-tracking

    I use a 3rd Party reporting service to track campaign performance, but it doesn’t match the Twitter Ads Dashboard

    Given the wide range of methodologies and features of 3rd party reporting services, it is unlikely that the numbers will align perfectly with the Twitter Ads dashboard. However, frequently discrepancies can be attributed to some of the following:

    • The user has opted out of Twitter tracking, or is using ad blocking software in their browser.
    • The Twitter conversion attribution windows are different between the Twitter UI and the 3rd party reporting service. Check to make sure they’re aligned.
    • Time zone differences — Twitter reports activity in your local timezone, please ensure that your 3rd party analytics provider does the same.
    • The advertiser’s campaign may be using click URLs that involve multiple redirects. Twitter users on low bandwidth internet connections may close their browser window if the page fails to load within a reasonable time frame. Twitter recommends using URLs with click parameters for tracking traffic and minimizing the number of redirects.

     


Did we help answer your question?

The maximum length for this field is 5000 characters.
Success
Thanks for submitting feedback on this article!
Error
Problem sending form.

Visit Twitter Ads