Skip to content

Instantly share code, notes, and snippets.

View rgoytacaz's full-sized avatar

Rodrigo Dellacqua rgoytacaz

View GitHub Profile
//marketingData Example
//vtexjs.checkout.orderForm.marketingData
//Example 1: GET UTMS FROM COOKIES OR EMPTY
utms = {
utmCampaign: (Cookies.get('IPS').indexOf('Campanha')!= -1 ? Cookies.get('IPS').split('Campanha=')[1].split('&')[0] : "" ),
utmMedium: (Cookies.get('IPS').indexOf('Midia')!= -1 ? Cookies.get('IPS').split('Midia=')[1].split('&')[0] : "" ),
utmSource: (Cookies.get('IPS').indexOf('Parceiro')!= -1 ? Cookies.get('IPS').split('Parceiro=')[1].split('&')[0] : "" ),
utmiCampaign: (Cookies.get('ISICI').indexOf('InternalCampaign')!= -1 ? Cookies.get('ISICI').split('InternalCampaign=')[1].split('&')[0] : "" ),
utmiPart: (Cookies.get('ISICI').indexOf('InternalPart')!= -1 ? Cookies.get('ISICI').split('InternalPart=')[1].split('&')[0] : "" )
@rgoytacaz
rgoytacaz / email.js
Last active July 10, 2018 02:06
How to add an email to VTEX Request Capture's session (Adds to Master Data and works for Abandoned Carts if items are available in the cart)
vtex.NavigationCapture.sendEvent('userContactInfo', { visitorContactInfo: ['[email protected]'] });