Skip to content

Instantly share code, notes, and snippets.

@andrewmcnaughton
Last active November 22, 2018 14:23
Show Gist options
  • Save andrewmcnaughton/0122feaf292ec0d7a0730f0ff9a3ef54 to your computer and use it in GitHub Desktop.
Save andrewmcnaughton/0122feaf292ec0d7a0730f0ff9a3ef54 to your computer and use it in GitHub Desktop.

End Point Setup:

Request URL w/ authentication, this will be updated when we go live: https://api-accp.spacesworks.com/ws/rest/marketingextern/v1/forms/membership;boomi_auth=c3BhY2Vzd29ya3NleHRlcm5Ac3BhY2VzYnYtSzdUTVJIOjMxODgwZmE1LWQ5ZWQtNDVjMS1hM2IyLTk4NGI5NmQ5MjNmNw==?eventuelequeryparameter=optioneel

Values:

{
   "title":"",
   "firstName":"",
   "lastName":"",
   "phone":"",
   "email":"",
   "company":"",
   "nrOfPeople":"",
   "productPackage":"",
   "locationTitle":"",
   "locationRequested":"",
   "startDate":"",
   "timeSchedule":"",
   "topic":"",
   "interestedIn":"membership",
   "comments":"",
   "minorSource":"",
   "majorSource":"",
   "sourceDetail":"",
   "contactThroughEmail":false,
   "locale":""
}

Extra headers

Cookies are set with GTM - The value of these cookie(s) will be the value of the headers required to be sent to the endpoint.

x-ga-clickid -> {{please parse the value of the cookie called gclid. Be aware, the cookie is only available when there is a GooglieClickID present / people coming via paid traffic.}}

x-ga-clientid -> {{please parse the value of the cookie gclientid}}

Hard Coded Values && Actions {{}}:

{
   "interestedIn":"membership",
   "comments":"This lead came via how.spacesworks.com / Spaces 10 years campaign. The client should be offered a day trial.",
   "minorSource":"{{please parse the value of the channel_attrib cookie}}",
   "majorSource":"marketing activity",
   "sourceDetail":"spaces-10-years-campaign",
   "locale":"{{parse the values of the country field}}"
}

Conditiona Values

If it's for a Dutch location (Country form field value = en_NL), please include following in the input profile

"locationRequested":"185",

Otherwise

"locationRequested":"0",

On successful Submission

<script>
  dataLayer.push({
    'event': 'enquiry'
    'type': 'membership',
    'locale': '{{locale}}'
  });
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment