How do I associate a website card to a line_item?


#1

I’m not seeing how to associate a website card to a line_item in the advertiser API.

This POST endpoint makes no mention of how to pass the ID of a tweet, or card. I think I’m missing something.

https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/line_items


Create a promotional Tweet with Website Card
#2

You can associate a promoted tweet with a line item using the promoted_tweet endpoint. The documentation for that endpoint is here: https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/promoted_tweets


#3

How would I associate a website card as the creative for a line_item (ad group)?

https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/cards/website

I’m not seeing how this is done.

Thanks for your help!


#4

It’s quite simple. Add preview_url to your tweet status :smiley:


#5

Thanks @hector_borras! I will try this out and keep you guys posted.


#6

Hi @sealabcore did you try this? did it work?
It looks like more of a hack than a proper solution to achieve this goal…


#7

Hi @billyyotpo ,

This is not a hack. If you look into Twitter Ads API documentation.

You should create a Tweet and concatenate yout tweet status with card’s preview_url, after that, you should post a promoted ad with this endpoint: https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/promoted_tweets with your line_item id and your tweet_id

Hopefully this will help you.

Regards!


#8

@billyyotpo Yeah it doesn’t feel like a hack and it works totally fine for us.


#9

Thanks both @hector_borras and @sealabcore!

So we are progressing with this solution.


#10

Hi @hector_borras
So how would I associate a lead gen card or app card as the creative for a Tweet ?


#11

Hi @anhtuan215

Process is really simple, but I know first time could be a little difficult to understand. Finally it isn’t different comared to Twitter Ads UI but abstracting some characteristics.

I hope if i divide the process in clear defined steps I can help you and other people that need the same solution.

First of all I should say that for Video Cards it’s a little different and I haven’t worked yet.

For the other ones.

How to associate a Twitter Ads Card to a Line Item

  1. Create your Website/App/Image App/ Lead Gen Card. As you usually do using your own images, titles and other properties that you need. Using the correct POST endpoint
  2. Retrieve from the response thet you get from the first point preview_url You should store this URL locally or in memory in order to use it later.
  3. Create a Tweet using https://ads-api.twitter.com/0/accounts/:account_id/tweet concatenating at the end previe_url we’ve get in previous point. Be carefull with the length of your tweet.
    Note: I know that you can use organic tweets to promote them but I think is not the case we’re trying to solve.
  4. In this step we have a tweet susceptible to be a promoted tweet, and a line item without any tweet ( :cold_sweat: ) with their respective Id’s, we’re going to call it tweet_id and line_item_id
  5. Create a Promoted Tweet using https://ads-api.twitter.com/0/accounts/:account_id/promoted_tweets providing both tweet_id and line_item_id (you can also send more than one tweet id.

Hopefully this will help you and more people!

Regards!


Can't import an image on a Website Card
#12

@hector_borras
It is worked, thanks for your help!. so you have the solution for video cards ?


#13

Thanks @anhtuan215

I haven’t got the solution for videocards because i’ve not worked with them yet. But I guess it could be pretty much the same…

Regards!