Archived

How to Add a Twitter Website Tag for Remarketing with Twitter Ads

Updated

Written by

Dave Warfel

Reading Time

3 minutes

If you buy something from one of our links, we may earn a commission.

Do you currently use Twitter Ads to market your products or services? Have you thought about increasing your social media presence?

Twitter Ads are a great way to increase your reach. You can run a campaign to gain more followers, drive traffic to your website or promote your most popular tweets.

Twitter Ads comes with lots of targeting options built-in, but there’s one thing you can do to segment your audience even further. Twitter remarketing allows you to target ads to people who have visited your website, or taken a certain action on your site. Before you can target ads to these people, you need to add a Twitter website tag to your website. Let’s walk through how to do that.

↓ Jump to video tutorial ↓

This tutorial is for adding a UNIVERSAL Twitter website tag that appears on every page of your site. If you’re looking to create a tag for a single event, pageview, purchase, etc., I’ll be creating another tutorial on that soon.

Add a Twitter Website Tag to your Site

  1. Login to your Twitter account
  2. Click on your profile image, and go to Twitter Ads

Twitter navigation: Twitter Ads

  1. Go to Tools > Conversion tracking

Twitter navigation: Tools > Conversion Tracking

  1. On the right, under “How to Start,” check the box to agree to Twitter’s advertising policy
  2. Click Generate website tag for conversion tracking

Getting started with Twitter website tag

  1. Copy the website tag to your clipboard

Twitter website tag code

Add Twitter Website Tag using a WordPress Plugin

  1. Install & activate the Insert Headers and Footers WordPress plugin
  2. Go to Settings > Insert Headers and Footers
  3. In the Scripts in Footer section, paste your Twitter website tag

Add Twitter website tag with WordPress plugin

Add Twitter Website Tag with Google Tag Manager

This assumes you already have Tag Manager installed on your website. If not, check out my tutorial on How to Install Google Tag Manager on WordPress.

  1. Login to your Google Tag Manager account
  2. Click on your container
  3. Click Add a new tag
  4. Give it a name. I recommend “Twitter Universal Website Tag”
  5. Choose Custom HTML Tag
  6. Under Configure Tag, paste your Twitter website tag into the box
  7. Under Fire On, choose All Pages
  8. Click Create Tag
  9. Don’t forget to publish your container when you’re done

Add Twitter Website Tag to your WordPress Theme

  1. In your active WordPress theme, open the footer.php file
  2. Locate the </body> tag
  3. Paste the Twitter website tag just above the </body> tag

NOTE: If you switch WordPress themes in the future, be sure to copy this and place it in your new theme, otherwise it’ll stop working. I recommend using Google Tag Manager or a WordPress plugin instead.

Verify your Twitter Website Tag is Installed & Tracking

After you’ve installed your tag, you’ll want to make sure it’s tracking properly. Wait a few hours, and then return to your Tools > Conversion Tracking page in the Twitter Ads dashboard. Look to see if your tag is Unverified or Tracking. If it’s been more than 24 hours, and you’ve been receiving traffic on your website, and it still says “Unverified,” see the troubleshooting guide.

Twitter Conversion Tracking status page

Twitter Website Tag Video Tutorial


I hope you enjoyed this tutorial on how to add the Twitter website tag to your site. If you have any trouble, please let me know in the comments.

Dave Warfel

LinkedIn  •  X (Twitter)
Dave has been working with WordPress since 2011. He's built 100s of client sites and almost a dozen of his own. He's tested almost every plugin you can think of, hosted with at least 10 different companies, and gone down every SEO rabbit hole you can imagine. When's he's not tinkering with new software, you'll find him in the mountains of Colorado, trail running, summiting peaks, and rippin' downhills on his mountain bike. 🏔️🏃🚴🤸

4 responses to “How to Add a Twitter Website Tag for Remarketing with Twitter Ads”

  1. Kayla at Oasis Workflow Avatar
    Kayla at Oasis Workflow

    Great value as always from WpSmackdown! Thank you for breaking down this complicated process! While Facebook ads have proven really useful for driving leads I think Twitter ads are going to become an amazing complement to content marketing. Great to have this step by step set up :).

    1. Dave Warfel Avatar

      Thanks Kayla!

      I just setup the Twitter website tag on WP Smackdown so that I can test out some remarketing soon. I’ll be writing about the entire process, from creating an audience to setting up the ads to the results. For marketing, WordPress, etc., I have a feeling Twitter ads might prove more helpful than Facebook. The data will tell us…

  2. Gugu Avatar
    Gugu

    Hi there. So in the video above you say at the end to upload the file via ftp to the server. Is this necessary and why? I did everything right so far and yet my Twitter dashboard still says code unverified. It’s only been 30 mins. Maybe I should wait longer? I just expected it to be instantaneous like Facebook. Appreciate any insight.

    1. Dave Warfel Avatar

      Hi Gugu — Unless you are an experienced WordPress developer, I recommend you use the “Insert Headers & Footers” plugin. It’s a much easier and safer way to add the Twitter Remarketing Tag. If you use that plugin, you won’t need to worry about updating your footer.php file, or uploading anything to a server.

      It should only take a minute or two (not 30) for Twitter to recognize it. However, if you’re using a caching plugin, you might need to clear your cache for Twitter to recognize that the tag is in place.

Leave a Comment