How to add different product to an ad from product sets in facebook marketing?
<p>I have completely read out the documentation of dynamic facebook marketing.Also successfully created an ad based on custom audience and pixel events.But the problem is that every time i am creating an ad it shows same product in ad templates.</p>

<p>Here is the code for setting up the Product set </p>

<pre><code>    product_set = ProductSet(None, &lt;CATALOG ID&gt;) # &lt;CATALOG ID&gt;
    product_set[ProductSet.Field.name] = 'Product Set'
    product_set[ProductSet.Field.filter] = {
        'product_type': {
            'i_contains': 'example product type',
        },
    }
    product_set.remote_create()
    product_set_id =  product_set[ProductSet.Field.id]
</code></pre>

<p>And Code for creating AD after setting campaign and adset :</p>

<pre><code>    adset = AdSet(parent_id='&lt;ACCOUNT_ID&gt;')
    adset[AdSet.Field.name] = 'Product Adset'
    adset[AdSet.Field.bid_amount] = 9100
    adset[AdSet.Field.billing_event] = AdSet.BillingEvent.link_clicks
    adset[AdSet.Field.optimization_goal] = AdSet.OptimizationGoal.link_clicks
    adset[AdSet.Field.daily_budget] = 45500
    adset[AdSet.Field.campaign_id] = campaign_id
    adset[AdSet.Field.targeting] = {
        Targeting.Field.publisher_platforms: ['facebook', 'audience_network'],
        Targeting.Field.device_platforms: ['desktop','mobile'],
        Targeting.Field.geo_locations: {
            Targeting.Field.countries: ['IN'],
        },
        Targeting.Field.product_audience_specs: [
            {
                'product_set_id': product_set_id,
                'inclusions': [
                    {
                        'retention_seconds': 2592000,
                        'rule': {
                            'event': {
                                'eq': 'ViewContent',
                            },
                        },
                    },
                ],
                'exclusions': [
                    {
                        'retention_seconds': 259200,
                        'rule': {
                            'event': {
                                'eq': 'Purchase',
                            },
                        },
                    },
                ],
            },
        ],
        Targeting.Field.excluded_product_audience_specs: [
            {
                'product_set_id': product_set_id,
                'inclusions': [
                    {
                        'retention_seconds': 259200,
                        'rule': {
                            'event': {
                                'eq': 'ViewContent',
                            },
                        },
                    },
                ],
            },
        ],
    }
    adset[AdSet.Field.promoted_object] = {
        'product_set_id': product_set_id,
    }

    adset.remote_create()
    adset_id = adset[AdSet.Field.id]
</code></pre>

<p>Can you guys help me out for the creating dynamic products from product set ?</p>