Get the UTM tags with Facebook Marketing API

2020-07-24 04:23发布

问题:

I have few ads on Facebook.

How should I get the UTM tags of this ads through the Facebook Marketing API?

So even nobody open the link with UTM tags, everyday I use Facebook Marketing API to get information about impressions, clicks, source, medium, keyword etc.

What method should I use? Or may I get the target URL with UTM tags from ad statistic? So how can I get the targeted URL (with UTM tags)?

I heard about Ad Report Stats, but there is no instruction anymore about it. This link doesn't work: https://developers.facebook.com/docs/reference/ads-api/adreportstats/

It redirects to the https://developers.facebook.com/docs/marketing-api/insights-api

Previously thanks!

回答1:

After so many trials, I could resolve this.

Case 1: Need Data from Campaign level to Ad data(Including UTM tags)

We need to get Campaign to Ad level data using Campaign insights edge. Once we get this we will have ad_id for each row of data. Then loop through each Ad and and pass ad_id to Ad campaigns edge in order to get UTM params. Field that gives us UTM tags is url_tags.

Unfortunately could not find a way around as no where in the marketing API docs there's a way mentioned to join both the edges to get end to end data(Campaign to Ad UTMtags)

Sources : 1) Get campaign to ad level data 2) Ad level data (including UTM)

Case 2 You have ad level data (Ofcourse ad_id)

In this case you have Ad creative edge where you pass ad_id as creative_id. This source will help you out.



回答2:

You should be able to access the target URLs from the ad creatives edge for each ad. See here for the documentation, noting in particular the various ad url data types here.

My understanding is that the target URL is not available from the Ad Insights edge