# Grabbing purchase info for GTM Data Layer

**URL:** <https://integration.keap.com/t/grabbing-purchase-info-for-gtm-data-layer/86550>\
**Category:** API Q&A\
**Created:** [February 20, 2022, 12:16pm UTC](https://integration.keap.com/t/grabbing-purchase-info-for-gtm-data-layer/86550 "2022-02-20T12:16:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bailey\_Proulx1](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@Bailey\_Proulx1](https://integration.keap.com/u/Bailey_Proulx1)\
**Post date:** [February 20, 2022, 12:16pm UTC](https://integration.keap.com/t/grabbing-purchase-info-for-gtm-data-layer/86550/1 "2022-02-20T12:16:14Z")

</div>

I need to add purchase information into the GTM Data Layer so I can push it to google tag manager.  
What are the parameters infusionsoft uses for:

First Name  
Last Name  
Email  
Address  
City  
State  
Zip  
Phone

I have all the variables ready in GTM, just need to know how Infusionsoft/keap stores this data.

Thanks!

---

<div class="post-metadata">

**Author:** ![TomScott](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/tomscott/32/67_2.png) [@TomScott](https://integration.keap.com/u/TomScott)\
**Post date:** [February 22, 2022, 4:03pm UTC](https://integration.keap.com/t/grabbing-purchase-info-for-gtm-data-layer/86550/2 "2022-02-22T16:03:48Z")

</div>

Good morning Bailey,

Are you trying to access those Contact details through the XMLRPC API or the REST API?

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [February 25, 2022, 6:56pm UTC](https://integration.keap.com/t/grabbing-purchase-info-for-gtm-data-layer/86550/3 "2022-02-25T18:56:29Z")

</div>

With the xml-rpc you’ll have

> [@Bailey\_Proulx1](#):
>
> First Name = FirstName  
> Last Name = LastName  
> Email = Email  
> Address = StreetAddress1 and StreetAddress2  
> City = City  
> State = State  
> Zip = PostalCode  
> Phone = Phone1

However, with REST you must submit it as a JSON structure:

> [@](#):
>
> {  
> “contact\_id”: 0,  
> “lead\_affiliate\_id”: 0,  
> “order\_date”: “2022-02-25T18:53:39.255Z”,  
> “order\_items”: [  
> {  
> “description”: “string”,  
> “price”: “string”,  
> “product\_id”: 0,  
> “quantity”: 0  
> }  
> ],  
> “order\_title”: “string”,  
> “order\_type”: “Offline”,  
> “promo\_codes”: [  
> “string”  
> ],  
> “sales\_affiliate\_id”: 0,  
> “shipping\_address”: {  
> “company”: “string”,  
> “country\_code”: “string”,  
> “first\_name”: “string”,  
> “is\_invoice\_to\_company”: true,  
> “last\_name”: “string”,  
> “line1”: “string”,  
> “line2”: “string”,  
> “locality”: “string”,  
> “middle\_name”: “string”,  
> “phone”: “string”,  
> “region”: “string”,  
> “zip\_code”: “string”,  
> “zip\_four”: “string”  
> }  
> }

HOWEVER, what you’re doing would be best served by utilizing the invoice or payment webhook triggers. These would send the id for the invoice or payment and then you’d use the api to pull the resulting record which would have that information in it. Here’s the link to the REST docs that show the structures involved:

[https://developer.infusionsoft.com/docs/rest/#!/E-Commerce/getOrderUsingGET\_1](https://developer.infusionsoft.com/docs/rest/#!/E-Commerce/getOrderUsingGET_1)
