googleads/google-ads-python

PMax Listing Group Status and Asset Group ID Discrepancy

rdhmdhl opened this issue · 2 comments

After making a request for a listing group status (included or excluded), the response is "UNIT_INCLUDED", but the specific listing group is actually excluded within the browser. Additionally, the asset group ID found in the asset_group.resource_name field, does not match the browser either. The odd piece here is that the metrics pulled in from the API (spend, clicks, ect.) match exactly to what is in the browser.

Here's the query I am using to pull in the listing group status and asset group resource name:

query = f"""
SELECT
asset_group.name,
asset_group.resource_name,
asset_group_listing_group_filter.resource_name,
asset_group_listing_group_filter.type
FROM asset_group_product_group_view
WHERE campaign.id = {campaign_id}
AND asset_group_listing_group_filter.case_value.product_item_id.value = '{product_id}'
AND asset_group.resource_name NOT IN ('{resource_name}')
LIMIT 1
"""

and here is the response:

SearchPager<results {
asset_group_listing_group_filter {
resource_name: "customers/9*********/assetGroupListingGroupFilters/647669048111178916796"
type_: UNIT_INCLUDED
}
asset_group_product_group_view {
resource_name: "customers/9*********/assetGroupProductGroupViews/6476690481
11178916796"
}
asset_group {
resource_name: "customers/9*********/assetGroups/6476690481"
name: "MDR"
}
}
field_mask {
paths: "asset_group.name"
paths: "asset_group.resource_name"
paths: "asset_group_listing_group_filter.resource_name"
paths: "asset_group_listing_group_filter.type"
}

I expected to see the asset_group_listing_group_filter.type_ to match the browser, as "UNIT_EXCLUDED". Additionally, I expected the asset_group.resource_name "customers/9*********/assetGroups/6476690481", to contain an ID at the end that matches the ID of this specific asset group shown in the browser (6480676138).

I understand that in my query I am excluding an asset group, that is intentional. Within the browser, the listing group is not included within any asset group. Yet, the API is showing the status as included.

Please see attached photos of the listing group status and asset group ID shown in the browser:
Screenshot 2024-02-27 at 2 36 38 PM
Screenshot 2024-02-27 at 1 55 19 PM

Dependencies:
boto3==1.28.63
botocore==1.31.63
cachetools==5.3.1
certifi==2023.7.22
charset-normalizer==3.3.0
google-ads==22.0.0
google-api-core==2.12.0
google-auth==2.23.3
google-auth-oauthlib==1.1.0
googleapis-common-protos==1.61.0
grpcio==1.59.0
grpcio-status==1.59.0
idna==3.4
jmespath==1.0.1
oauthlib==3.2.2
proto-plus==1.22.3
protobuf==4.24.4
pyasn1==0.5.0
pyasn1-modules==0.3.0
python-dateutil==2.8.2
python-dotenv==1.0.0
PyYAML==6.0.1
requests==2.31.0
requests-oauthlib==1.3.1
rsa==4.9
s3transfer==0.7.0
six==1.16.0
urllib3==2.0.6

I've observed that when I include the asset_group.status field in the AND clause of the query, it accurately selects the intended asset group, as evidenced by the correct asset group ID being returned in the response. Subsequently, this adjustment also results in the accurate representation of the listing group status.

Prior to incorporating the asset_group.status into the AND clause, the query was erroneously retrieving an asset group marked as "Removed". Despite this, the listing group associated with this incorrect asset group displayed metrics identical to those visible in the browser interface.

Could anyone shed light on why the query behaves differently without specifying the asset_group.status in the AND clause? Is this expected behavior, or might it indicate a potential issue with how the query filters based on the status field? Removed asset groups are not viewable within the browser UI.

Here's the new query:

    SELECT    
        asset_group.name,
        asset_group.resource_name,
        asset_group_listing_group_filter.resource_name,
        asset_group_listing_group_filter.type,
        campaign.id,
        asset_group.status
    FROM asset_group_product_group_view
    WHERE campaign.id = {campaign_id}
    AND asset_group.status = 'ENABLED'
    AND asset_group_listing_group_filter.case_value.product_item_id.value = '{product_id}'
    AND asset_group.resource_name NOT IN ('{resource_name}')
    LIMIT 1

Hi @rdhmdhl - this looks like an issue with the API itself and not this library. I recommend reaching out to our API support channel here