The "purchase completed" tag is a snippet of HTML code used to describe a completed purchase.
What is this tag and where is it used?
The "cn_purchase" tag must be inserted on the first page visited after a purchase. Usually, this page will be the purchase confirmation page.
Properties
The different properties of a cart must be defined within the “cn_cart” tag as child tags, indicating the name of the property in the “class” attribute.
Each different product in the cart is indicated by a tag with the class “product_basket_item”, which includes their quantity and amount.
The properties to be included in the tag are:
Name |
Required |
Type |
Multiple |
Description |
---|---|---|---|---|
total_quantity |
Yes |
integer |
No |
Total number of products in the cart (including duplicates). |
total_price |
Yes |
decimal |
No |
Total amount of the purchase. |
purchase_date |
No |
string |
No |
Date of purchase. Awaiting ISO_8601 form. |
product_basket_item |
No |
Yes |
Items contained in the cart, together with their quantity and the amount. |
|
purchase_id |
Yes |
string |
No |
Unique purchase identifier. |
cart_id |
No |
string |
No |
Unique identifier of the cart from which this purchase originated. |
Example
Once the properties are included, the tag will look like this:
<div class="cn_purchase " style="display:none">
<span class="cart_id">crt8679803</span>
<span class="purchase_id">prchs5241</span>
<span class="purchase_date">2017-09-29 14:12:37.430Z</span>
<span class="total_quantity">3</span>
<span class="total_price">180.75</span>
<span class="payment_method">Credit card</span>
<div class="product_basket_item">
<span class="quantity">3</span>
<span class="price">180.75</span>
<span class="url">http://example.org/products/pr9658</span>
<span class="product_id">pr9658</span>
<span class="name">Teclado Gaming Logitech Pro v.1.5</span>
<span class="description">Teclado inalámbrico retroiluminado de alta gama, personalizable y resistente a líquidos y caídas.</span>
<span class="image_url">http://example.org/img/products/pr9658.jpg</span>
<span class="unit_price">60.25</span>
<span class="availability">InStock</span>
<span class="category">/Ordenadores/Teclados/Logitech</span>
<span class="category">/Ordenadores/Gaming</span>
<span class="tag">Azul</span>
<span class="tag">Gaming</span>
<span class="tag">Retroiluminado</span>
<span class="tag">Inalámbrico</span>
<span class="brand">Logitech</span>
<span class="review_count">9</span>
<span class="rating_value">4.5</span>
<span class="thumbnail_url">http://example.org/img/thumbnails/products/pr9658.jpg</span>
<span class="related_external_product_id">pr10636</span>
<span class="related_external_product_id">pr11939</span>
<span class="related_external_product_id">pr12653</span>
<span class="published_at">2020-05-20T15:24:20Z</span>
<span class="custom_field_1">Información personalizada de ejemplo</span>
</div>
</div>
Keep learning!
To make the most of your Connectif account, we recommend reading these articles next:
- Integration using tags, to discover all the notifications you can send from your ecommerce to Connectif and how they work.
- Integration using JavaScript events, to learn about this type of integration, which give you greater control over when and how to send events.
- Integration with Connectif via API, to synchronize contacts, products, purchases and vouchers.
- Check the integration with your ecommerce, so you can be confident that your data is syncing correctly with your Connectif account.