Skip to content

[amp story shopping] Implement analytics #37765

@processprocess

Description

@processprocess

Description

We need to track the following events and send the associated information as a label.
We also need to add a new section for shopping in the amp-story-auto-analytics documentation.

pseudo code:
event: PLP view label: story page id
event PDP view label product id
event Buy now click label product id
event Shopping tag click label product id

Since we need to use UA at the time of this PR, we cannot send additional metadata with each event.

Pseudo code of what we need to add.
Please ensure that the events are being registered as expected in the GA dashboard.

    'storyShoppingPlpView': {
      'on': 'story-shopping-plp-view',
      'vars': {
        'event_name': 'custom',
        'event_action': 'story_shopping_plp_view',
        'event_category': '${title}',
        'event_label': '${storyPageId}',
        'send_to': [gtagId],
      },
    },    
    'storyShoppingPdpView': {
      'on': 'story-shopping-pdp-view',
      'vars': {
        'event_name': 'custom',
        'event_action': 'story_shopping_pdp_view',
        'event_category': '${title}',
        'event_label': '${storyShoppingProductId}',
        'send_to': [gtagId],
      },
    },
    'storyShoppingBuyNowClick': {
      'on': 'story-shopping-pdp-view',
      'vars': {
        'event_name': 'custom',
        'event_action': 'story_shopping_buy_now_click',
        'event_category': '${title}',
        'event_label': '${storyShoppingProductId}',
        'send_to': [gtagId],
      },
    },
    'storyShoppingTagClick': {
      'on': 'story-shopping-tag-click',
      'vars': {
        'event_name': 'custom',
        'event_action': 'story_shopping_tag_click',
        'event_category': '${title}',
        'event_label': '${storyShoppingProductId}', // be sure this is set by the time this sends
        'send_to': [gtagId],
      },
    }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions