Skip to content

Instantly share code, notes, and snippets.

@webhasan
Last active September 2, 2023 09:37
Show Gist options
  • Save webhasan/08c3fb34450463af3da7bf0fd3ef94c0 to your computer and use it in GitHub Desktop.
Save webhasan/08c3fb34450463af3da7bf0fd3ef94c0 to your computer and use it in GitHub Desktop.

Each section of the product should have class: gtm-item

In the title of the product or somewhere should have information (Change the value to right value)

class="gtm-item-title" data-gtm-product-id="4401.1" data-gtm-item-title="6-Hour 44547 CE Broker Responsibility Corr"

If there is two product together then use following instead top one (Change the value to right value)

class="gtm-item-title" data-gtm-multi="1" data-gtm-product-id="4102" data-gtm-product-id2="4401.1" data-gtm-item-title2="6-Hour 44547 CE Broker Responsibility Corr" data-gtm-item-title="SAE pkg I (98 Hour) Correspondence"

class: CSS class

data-gtm-product-id: Product Id

data-gtm-product-id2: Second product id of same section

data-gtm-item-title: Title of the product

data-gtm-item-title2: Second product title of same section

data-gtm-multi="1" Use this if multiple product in same section

If there is two product in same section use gtm-add-to-cart-2 class for second product’s purchase button.

For product price we need to add a class gtm-item-price on price element. If there are 2 products in same section then for second product price class is gtm-item-price2

For view_item_list use following code somewhere in page: class="view-item-list" data-item-list-id="29229" data-item-list-name="Real estate business blueprint"

class: CSS calss

data-item-list-id: Id of the list, our cases page id

data-item-list-name: Name of the list, page title or whatever your like

Watch the video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment