2

I have some code that seems to get close, but not quite:

import time

from facebook_business.adobjects.adspixel import AdsPixel
from facebook_business.adobjects.adspixelstats import AdsPixelStats


pixel = AdsPixel(<MYPIXELID>)
pixel.get_stats(params={
    'aggregation': 'custom_data_field', #url
    'event': 'Purchase',
    'start_time': int(time.time()) - 3600 * 24 * 1,
    'end_time': int(time.time()),
})

This outputs:

<AdsPixelStatsResult> {
    "aggregation": "custom_data_field",
    "data": [
        {
            "count": 20,
            "value": "order_id"
        },
        {
            "count": 20,
            "value": "content_name"
        },
        {
            "count": 20,
            "value": "value"
        },
        {
            "count": 20,
            "value": "currency"
        },
        {
            "count": 20,
            "value": "content_type"
        }

How can I access the values of all my parameters, not just the counts? For instance, what did we send in as "content_type", or "content_name"?

jrjames83
  • 901
  • 2
  • 9
  • 22

0 Answers0