Aggiungi i tuoi codici evento

Sembra che tu stia visualizzando l'elemento da un'area geografica in cui il tag di Pinterest non è ancora disponibile. Scopri dove è disponibile il tag di Pinterest per gli account di Pinterest Business.

Ulteriori informazioni

I codici evento ti consentono di misurare l'impatto che i tuoi annunci di Pinterest hanno su determinato azioni sul sito. Sono necessari anche per lanciare campagne che si ottimizzino automaticamente in caso di eventi specifici. 

Prima di iniziare: devi aver installato il codice di base prima di poter aggiungere i codici evento. Assicurati che i codici evento vengano eseguiti dopo il codice di base.

Copia il codice evento in Gestione annunci

  1. Apri Gestione annunci.
  2. Dal menu a discesa Annunci, seleziona Conversioni.
  3. Seleziona il tuo tag.
  4. Copia il codice relativo all'evento che vuoi monitorare.
     

Aggiungi un codice evento al tuo sito web

Per monitorare gli eventi, devi aggiungere uno snippet HTML al codice del tuo sito web.

  1. Apri il codice relativo alla pagina su cui vuoi monitorare un evento.
  2. Incolla il codice evento:
    • Gli eventi di caricamento pagina si attivano ogni volta che la pagina viene caricata: incollalo nell'intestazione, prima del codice di base.
    • Gli eventi azione utente si attivano a seguito di un'azione: i passaggi esatti da implementare dipendono dal caso d'uso e dagli eventi che stai monitorando.

Questi sono gli eventi che puoi monitorare con il tag di Pinterest e se questi includono la creazione del pubblico e i report sulle conversioni. 

Evento

Creazione del pubblico

Report sulle conversioni

Checkout

AddToCart

PageVisit

Signup

WatchVideo

Lead

Search

ViewCategory

Personalizzato*

[Evento definito dall'utente]**

 

*Monitora un evento personalizzato. Utilizza il nome di questo evento per monitorare un evento speciale che vuoi includere nel report sulle conversioni
**Aggiungi eventuali altri eventi che hai definito per l'obiettivo del targeting del pubblico. Gli eventi unici non sono disponibili per i report sulle conversioni. Tieni presente che gli spazi vuoti verranno eliminati dai nomi degli eventi originari elaborati dal tag

 

Qual è il passaggio successivo?

Controlla se tutto funziona correttamente: Come verificare il tag di Pinterest

Types of event codes

The table below shows the events that you can track with the Pinterest tag. You can use them to create audiences for ads targeting and you can see related paid and organic conversion reporting on Ads Manager. Note: Reporting is not available for user-defined events.

Event Purpose
Checkout Track people who complete transactions.
AddToCart Track people who add items to shopping carts.
PageVisit Track people who view primary pages, such as product pages and article pages.
Signup Track people who sign up for your product or service.
WatchVideo Track people who watch videos.
Lead Track people who show an interest in your product or service.
Search Track people who search on your website for specific products or shop locations.
ViewCategory Track people who view category pages.
Custom Track a custom event. Use this event name to track a special event that you want to include in your conversion reporting.
[User-defined event] Add any additional events that you’ve defined for the purpose of audience targeting. Unique events are not available for conversion reporting. Keep in mind that any spaces in the custom event names passed through the tag will be removed.

Add event codes to your website

If your window is still open on Ads Manager from when you copied your base code, click Continue on the bottom-right corner of the box on your screen to view all of your options and click Copy code beside the event you want to track.

If your window is not still open, follow the steps below.

  1. Copy the code for the event that you want to add to your website from the list of examples below.
  2. Open the code for the page of your website that you want to track an event on.
  3. Paste the event code between the <head> and </head> tags on your page, after the base code, making sure to replace any example values with the appropriate value for your website. This means the event will fire any time the page is loaded.

Note: If an event is triggered only after a user takes a specific action on the page such as clicking a button or submitting a form, make sure that the event code only runs as a result of that action. This requires an understanding of the existing event handlers in your page’s JavaScript code.

Add event data

You can provide additional information about an event by attaching an object that contains event data. All event data is available for audience targeting but only value and order_quantity event data are available for paid and organic conversion reporting.

Event data Sample value Type
value 100.00 Number (integer or floating point)
order_quantity 1 Integer
order_id 1234OrderID String (order_id is required for conversion analysis reporting) 
product_name Parker Boots line_items array, string
product_id 1414 line_items array, string
product_category Shoes line_items array, string
product_variant_id 1414-Red line_items array, string
product_variant Red line_items array, string
product_price 99.99 Number (integer or floating point), line_items array, string
product_quantity 1 Integer, line_items array, string
product_brand Parker line_items array, string
promo_code WINTER10 String
property Athleta String
search_query boots String
video_title How to style your Parker Boots String
lead_type Newsletter String
currency USD One of the following: AED, AMD, ARS, AUD, AZN, BAM, BGN, BHD, BMD, BND, BOB, BRL, BSD, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DOP, EGP, EUR, FJD, GBP, GEL, GIP, HKD, HNL, HRK, HUF, IDR, ILS, INR, ISK, JMD, JPY, KGS, KRW, KWD, KZT, MAD, MDL, MOP, MXN, MYR, NOK, NZD, OMR, PAB, PEN, PHP, PKR, PLN, QAR, RON, RSD, RUB, SAR, SEK, SGD, THB, TRY, TWD, UAH, USD, UYU, VND or ZAR

Include event data in the IMG tag

The IMG tag is a piece of code within the Pinterest tag that acts as a backup in case people have disabled JavaScript in their browsers. We recommend that you include event data in the IMG tag too as this enables better user targeting. You can choose to only use the IMG tag and not the JavaScript tag but you will have to remove the <noscript> tags from the code.

Pass value and order_quantity event data dynamically

Value and order_quantity are the two pieces of event data available in paid and organic conversion reporting. If you want to add value and quantity, you can pass them back dynamically. A dynamic value can change depending on the action taken on your site. If you choose to pass back value and order_quantity, this will be unique to your website and how you record sales. The value and quantity of products in each order placed on your website usually varies.

Pass a JavaScript callback function

In addition to event data, you can pass a JavaScript callback function as an optional argument to the function pintrk(). This provides additional information if something has gone wrong with your tag which you can check in your developer tool. This callback function runs every time an event tracking call, the function pintrk(), is triggered.

The callback function takes the following two arguments:

function(didInit, error) {}
  • didInit: This first argument receives a boolean value, which is set to be true if the event tracking call is successfully constructed and false if an error is detected while making the event tracking call.

  • error: This second argument receives a string, which describes the error when didInit returns false; if didInit is true, this string is undefined.

Event code examples

For conversion tracking and reporting, you must specify one of the nine event types in the event code. You must also replace YOUR_TAG_ID with your Pinterest conversion tag ID. Remember that you can include any combination of event data per event besides what’s shown in the examples below.

Examples of combined base code and event codes

Here are some examples of base codes combined with event codes. Remember to confirm the event code is placed after the base code on your website.

What’s the next step?

Learn more about tag parameters and cookies or enable optional Enhanced Match. If you do not want to do either, verify your Pinterest tag.

Hai ancora bisogno di aiuto?
Contattaci