Sunday, 15 September 2013

javascript - Google Tag Manager submit form data -



javascript - Google Tag Manager submit form data -

i'm trying implement gtm passed values search form after post request.

datalayer.push({'event': 'check-availability', 'avcheckin': 'april 3, 2014', 'avcheckout': 'april 7, 2014', 'location': 'form name’, 'guests': '2', 'propertyname': 'property name'});

how create tag, rule , macros in gtm

gtm works javascript, not grab post values. you'd need grab values serverside, render them page code key/value paris in datalayer. can create new macros if datalayer type , values specifying key.

you might alter form utilize method, in case grab parameters via url macros (macro type "url", component type "query", "query key" key variable want url).

but long you're using post values there no way gtm alone, you'd need sort of server side scripting output values page code.

javascript seo google-tag-manager

No comments:

Post a Comment