mitodl / mitxpro

BSD 3-Clause "New" or "Revised" License
12 stars 2 forks source link

catalog: product page microdata #1887

Closed pdpinch closed 4 years ago

pdpinch commented 4 years ago

As a Facebook user, I'd like to see ads for xPRO courses based on my interests in course topics.

Facebook has a tool called catalogs which helps Facebook inventory the products that your organization is trying to promote on Facebook. https://www.facebook.com/business/help/1275400645914358?id=725943027795860

The product requires some additional metadata on each for product page for the catalog to pull from.

Acceptance Criteria:

On product pages, add the following metatags:

and on the checkout page, add the following values to the dataLayer push event:

for example, on https://xpro.mit.edu/programs/program-v1:xPRO+MLx/ tags would be (in addition to existing

<meta property="og:image" content="https://xpro-app-production.s3.amazonaws.com/images/ML-image-2.2e16d0ba.fill-870x500.jpg">
<meta property="product:brand" content="xPro">
<meta property="product:availability" content="in stock">
<meta property="product:condition" content="new">
<meta property="product:price:amount" content="2149">
<meta property="product:price:currency" content="USD">
<meta property="product:retailer_item_id" content="program-v1:xPRO+MLx">
<meta property="product:category" content="317">
asadiqbal08 commented 4 years ago

@pdpinch can you point out the possible value for og:description ?

pdpinch commented 4 years ago

I think we could use either the description field, found under the promote tab in the CMS, or we could use the program/course subhead.

Let me ask some others and get back to you.

pdpinch commented 4 years ago

Please use the description field from the promote tab in the CMS. This is currently empty in production, but the marketing team has committed to populating it.

briangrossman commented 4 years ago

@asadiqbal08

This is mostly good, but there were a couple issues. I've attached an image below with details about what didn't work.

ef6ae380-f442-11ea-9cf3-4f1692d4a08d
asadiqbal08 commented 4 years ago

@briangrossman After investigating it, Can you confirm the follow 2 things about the point that you indicated above.

briangrossman commented 4 years ago

@asadiqbal08

I'm not sure I understand your questions completely.

  • Do you have set the current price for product ? as there is condition over amount page.product.current_price

I don't understand what you mean by _there is condition over amount page.product.current_price_ Are you saying there's some kind of condition that makes it not possible to retrieve the value?

  • Do you have enabled the gtmTrackingID over the checkout page ? as the Data Push Layer event is initiated under this condition

I'm not sure about where and if that value is enabled. Peter confirmed that it should be enabled throughout the entire side and it looks like @ahmed-belal has done some work related to it in the past. Maybe he has some insights?

ahmed-belal commented 4 years ago

@briangrossman @asadiqbal08

asadiqbal08 commented 4 years ago

Do you have set the current price for product ? as there is condition over amount page.product.current_price

I don't understand what you mean by there is condition over amount page.product.current_price Are you saying there's some kind of condition that makes it not possible to retrieve the value?

@briangrossman I just mean, there should be some current_price associated with that product else it will not render in meta tags.

briangrossman commented 4 years ago

@asadiqbal08 In terms of the price, here's an example: https://xpro.mit.edu/courses/course-v1:xPRO+SysEngx1/ There seems to be a price associated with that course ($949). It is displayed on the page: image

Ideally you could use the same logic for getting the price as what is currently used on the page already. I imagine since the price is associated with the product, but the product is associated with the course run (not the course), it would take a little work.

Here's the missing data in the HTML: image

Thanks!

asadiqbal08 commented 4 years ago

PR is up now for review as per new A/C by Sam.

briangrossman commented 4 years ago

Closing