Cleaning a GTM Template - google-tag-manager

We are currently using a GTM template provided by an advertising firm. We intend to no longer use this firm but would like to keep the same tags in place. We don't want our data being sent back to them as a result of the GTM template. I have taken out any sensitive information but would like to know which values to remove or change.
The Template URL under Add to Cart would obviously need to be changed but what about container id or path? Are these just informational concerning the account that exported this file or does this pass data back to their account? The specified tagManagerUrl does not match my account.
Anything else to look out for? I have attached a small segment of the file.
Thank you
{
"exportFormatVersion": 2,
"exportTime": "2019-01-10 11:11:11",
"containerVersion": {
"path": "accounts/XXX/containers/XXX/versions/0",
"accountId": "XXX",
"containerId": "XXX",
"containerVersionId": "0",
"container": {
"path": "accounts/XXX/containers/XXX",
"accountId": "XXX",
"containerId": "XXX",
"name": "the Container",
"publicId": "GTM-XXX",
"usageContext": [
"WEB"
],
"fingerprint": "XXX",
"tagManagerUrl": "https://tagmanager.google.com/#/container/accounts/XXX/containers/XXX/workspaces?apiLink=container"
},
"tag": [
{
"accountId": "XXX",
"containerId": "XXX",
"tagId": "10",
"name": "Add Item to Cart",
"type": "img",
"parameter": [
{
"type": "BOOLEAN",
"key": "useCacheBuster",
"value": "true"
},
{
"type": "TEMPLATE",
"key": "url",
"value": "https://AdVendorURL/xxx/item?&XXX"
},
{
"type": "TEMPLATE",
"key": "cacheBusterQueryParam",
"value": "gtmcb"
}
],
"fingerprint": "XXX",
"firingTriggerId": [
"7"
],
"tagFiringOption": "ONCE_PER_EVENT",
"monitoringMetadata": {
"type": "MAP"
}
},

I would not remove anything from the template. In your Google Tag Manager container go to Admin > Import Container and follow the instructions to import the configuration. Once you have complete go to your Workspace and select Tags from the menu. Locate the tag Add Item to Cart and remove it.

Related

Azure ARM and SQL Database size

Here is the portion of my ARM file about the database:
{
"type": "Microsoft.Sql/servers/databases",
"name": "[concat(variables('SqlServerName'), '/', variables('dbName'))]",
"tags": {
"displayName": "Database"
},
"location": "[resourceGroup().location]",
"apiVersion": "2020-02-02-preview",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('SqlServerName'))]"
],
"properties": {
"collation": "[parameters('dbCollation')]",
"edition": "[parameters('dbEdition')]",
"maxSizeBytes": "53687091200",
"requestedServiceObjectiveName": "[parameters('dbRequestedServiceObjectiveName')]"
}
}
And here my parameters:
"dbEdition": {
"value": "Standard"
},
"dbRequestedServiceObjectiveName": {
"value": "S2"
}
But these database properties are ignored and the deployed database doesn't respect them.
What's wrong?
UPDATE
As #SwathiDhanwada pointed out in comments, the edition property may not exist as per the doc.
I should use sku defined like:
Yet the powershell script to get a list of available skus for a given location returns something like:
The headers of the table are not the same as the properties of the sku object 🤦‍♂️

How to send event parameters for a tag through the google tag manager API

With this query i can create a GTM event tag for Google Analytics 4. i would like to pass some event parameters aswell. I feel that im really close because the API seems to recognize the eventParameters key, it tells me that its value its invalid.
"vendorTemplate.parameter.eventParameters[0]: The value is invalid.\n",
If i change this eventParameters key to something else, the query goes through (obviously without taking into consideration my eventParameters) so i know that this code has to be close.
The documentation is really shallow so building queries with the GTM api its been very trial and error until now.
When i get this working i'll probably make a sample for automating trigger and tag creation for GA4 migrations
`
{
"name": "test2",
"type": "gaawe",
"parameter": [
{
"type": "template",
"key": "eventName",
"value": "hey"
},
{
"type": "tagReference",
"value": "LocalTag",
"key": "measurementId"
},
{
"type": "list",
"key": "eventParameters",
"list": [
{
"type": "template",
"value": "page_title",
"key": "page_title"
}
]
}
]
}
`
The parameters is a array
Here is the example:
{
"type": "MAP",
"map": [
{
"type": "TEMPLATE",
"key": "name",
"value": `${parameterName}`
},
{
"type": "TEMPLATE",
"key": "value",
"value": `${parameterValue}`
}
]
}
And if you want to pass a variable to the value
Just add the "{{" , "}}" as you used in GTM UI.
Like {{DataLayer-Ecommerce}}
So yes you are very close to it.

Getting all profiles from Google Analytics API

I'm trying to get all profiles using ~all option with this endpoint
https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles
It doesn't return all profiles due to ~all for accounts. If I include account ID instead of ~all, then it returns profiles based on that account id - which are missing when used with ~all option.
https://www.googleapis.com/analytics/v3/management/accounts/89478503/webproperties/~all/profiles
Am I doing something wrong or is this GA API bug?
I sugst you look into using account summaries list
GET https://www.googleapis.com/analytics/v3/management/accountSummaries
This will return all the account information for a user.
{
"kind": "analytics#accountSummaries",
"username": "me#gmail.com",
"totalResults": 15,
"startIndex": 1,
"itemsPerPage": 1000,
"items": [
{
"id": "59183475",
"kind": "analytics#accountSummary",
"name": "Cube Analytics",
"webProperties": [
{
"kind": "analytics#webPropertySummary",
"id": "UA-59183475-1",
"name": "Cube Analytics",
"internalWebPropertyId": "93305066",
"level": "STANDARD",
"websiteUrl": "XXXXXXX",
"profiles": [
{
"kind": "analytics#profileSummary",
"id": "115455750",
"name": "Alaternate",
"type": "WEB"
},
{
"kind": "analytics#profileSummary",
"id": "97191919",
"name": "All Web Site Data",
"type": "WEB"
},
{
"kind": "analytics#profileSummary",
"id": "178538323",
"name": "MobileView",
"type": "APP"
}
]
}, ]
}
By using this call you should only need to make one call and get all of the information back.

OneDrive API search based on a keyword gives only section information and doesnot give any information about page details

I want to know the page id or page url which has paternity in the content. When i use search functionality, i get the section details but i don't get any information about page.
Query:
https://graph.microsoft.com/v1.0/me/drive/root/search(q='paternity')
Result:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
"value": [
{
"#odata.type": "#microsoft.graph.driveItem",
"createdDateTime": "2018-07-11T11:06:28Z",
"id": "dfhsdfkhfklsdfsdkjf",
"lastModifiedDateTime": "2018-07-11T11:20:26Z",
"name": "Section1.one",
"webUrl": "https://microsoft-my.sharepoint.com/personal/abcd_contoso_com/_layouts/15/WopiFrame.aspx?sourcedoc=%7B7E1C4305-983D-4CE2-A15E-DBAF1B961423%7D&file=Section1.one&action=default&DefaultItemOpen=1",
"size": 390328,
"createdBy": {
"user": {
"email": "abcd#contoso.com",
"displayName": "abcd"
}
},
"lastModifiedBy": {
"user": {
"email": "abcd#contoso.com",
"displayName": "abcd"
}
},
"parentReference": {
"driveId": "b!QqRkFzhjsdgjkdhfkjdhXiDBfhDiNEmqz4NJGbg-Gcv-NrFDvVRJca8R9-3ylQ",
"driveType": "business",
"id": "01QsdjhdkjhdsdkjhHGT4FXINN2A"
},
"file": {
"mimeType": "application/msonenote"
},
"fileSystemInfo": {
"createdDateTime": "2018-07-11T11:06:28Z",
"lastModifiedDateTime": "2018-07-11T11:20:26Z"
},
"searchResult": {}
}
]
}
Please advise on how to get page level information
The OneNote API has search - you may try using that one:
https://blogs.msdn.microsoft.com/onenotedev/2014/11/17/introducing-the-onenote-search-api-beta-powered-by-bing/

Alfresco Restful API to get custom metadata

We are moving to Alfresco Content Management system and there is no direct documentation for retrieving custom metadata.
Is there a way to get custom metadata/ custom properties that I have added to Record category in Alfresco Records Management File plan? Custom metadata is basically the data fields that are in scanned document like name, dob, form id, etc.
Eg: I have created RM site and added the following file plan.
TestCategory
|
--TestFolder1
|
--Record1
--Record2
|
--TestFolder2
|
--Record1
--Record2
These records contains uploaded form(scanned document) along with metadata (custom).
To Retrieve metadata, am using
http://127.0.0.1:8090/alfresco/service/api/metadata/node/workspace/SpacesStore/ed6e2cc6-6dc5-4bfb-bf9d-b450f68863dd?alf_ticket=TICKET_06265902898618fe5a46e67992e07a9d4b72701a
It is returning 405-Method not allowed (GET not supported).
To Retrieve all the subfolders/documents in Folders, m using
http://127.0.0.1:8090/alfresco/service/slingshot/doclib/doclist/documents/site/rm/documentLibrary/TestCat1/TestFolder2
Above one returns
{
"totalRecords": 1,
"startIndex": 0,
"metadata": {
"repositoryId": "3b9d4f67-dc84-4531-b8b2-4dbcef15e25a",
"container": "workspace://SpacesStore/7d1349bb-5289-4709-9055-c75c03ab5481",
"parent": {
"nodeRef": "workspace://SpacesStore/5d40660e-64d9-4bc4-a75e-ae4ae8b2201a",
"permissions": {
"userAccess": {
"create": true,
"edit": true,
"delete": true,
"cancel-checkout": false,
"permissions": true
}
}
},
"onlineEditing": true,
"itemCounts": {
"folders": 0,
"documents": 1
}
},
"items": [
{
"nodeRef": "workspace://SpacesStore/65b9b52b-3418-4a85-98b0-d4770cf9399d",
"nodeType": "cm:content",
"type": "document",
"mimetype": "application/pdf",
"isFolder": false,
"isLink": false,
"fileName": "BO (2016-1464237424392).pdf",
"displayName": "BO (2016-1464237424392).pdf",
"status": "",
"title": "þÿ",
"description": "test description",
"author": "",
"createdOn": "2016-05-26T00:37:04.350-04:00",
"createdBy": "Administrator",
"createdByUser": "admin",
"modifiedOn": "2016-05-31T15:50:21.269-04:00",
"modifiedBy": "Administrator",
"modifiedByUser": "admin",
"lastThumbnailModification": "doclib:1464237426243",
"lockedBy": "",
"lockedByUser": "",
"size": "156702",
"version": "1.0",
"contentUrl": "api/node/content/workspace/SpacesStore/65b9b52b-3418-4a85-98b0-d4770cf9399d/BO%20(2016-1464237424392).pdf",
"webdavUrl": "/webdav/Sites/rm/documentLibrary/TestCat1/TestFolder2/BO%20(2016-1464237424392).pdf",
"actionSet": "document",
"tags": [],
"activeWorkflows": "",
"isFavourite": false,
"likes": {
"isLiked": false,
"totalLikes": 0
},
"location": {
"repositoryId": "3b9d4f67-dc84-4531-b8b2-4dbcef15e25a",
"site": "rm",
"siteTitle": "Records Management",
"container": "documentLibrary",
"path": "/TestCat1/TestFolder2",
"file": "BO (2016-1464237424392).pdf",
"parent": {
"nodeRef": "workspace://SpacesStore/5d40660e-64d9-4bc4-a75e-ae4ae8b2201a"
}
},
"permissions": {
"inherited": true,
"roles": [
"ALLOWED;ROLE_EXTENDED_READER;ReadRecords;INHERITED",
"ALLOWED;GROUP_Administrator7d1349bb-5289-4709-9055-c75c03ab5481;Filing;INHERITED",
"ALLOWED;ROLE_EXTENDED_WRITER;Filing;INHERITED"
],
"userAccess": {
"create": true,
"edit": true,
"delete": true,
"cancel-checkout": false,
"permissions": true
}
},
"custom": {},
"actionLabels": {}
}
]
}
Using PostMan chrome app to test rest api. TIA.
Another way to do this: I found it in Alfresco forums :
/alfresco/service/api/metadata?nodeRef=workspace://SpacesStore/a2a6c249- c55d-4d29-8692-3e9cb1f811a8 [GET service]
This should do it. Example request.
http://localhost:8080/alfresco/service/slingshot/doclib2/node/workspace/SpacesStore/f558838b-24fa-4ea3-bb2a-602c7b4cec41
Give it a shot, it will return everything you need, not only metadata but for example aspects too.
If the response you are getting is overwhelming for anyone like me, in the accepted (great) answer/solution given by Lista, here is a simpler way:
HTTP GET:
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb
Need some more details? Try this:
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb?include=association,path,permissions
You will get a response similar to this:
{"entry":{"isFile":true,"createdByUser":{"id":"admin","displayName":"Administrator"},"modifiedAt":"2020-12-16T00:01:56.615+0000","nodeType":"cm:content","content":{"mimeType":"application/pdf","mimeTypeName":"Adobe PDF Document","sizeInBytes":8037,"encoding":"UTF-8"},"parentId":"c250f9c5-d3f9-4c9e-83c6-2d239f8c2237","aspectNames":["cm:versionable","cm:titled","cm:auditable","cm:taggable","cm:author"],"createdAt":"2020-12-13T16:48:27.600+0000","isFolder":false,"modifiedByUser":{"id":"admin","displayName":"Administrator"},"name":"fileName","id":"dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb","properties":{"cm:title":"titletest","cm:versionType":"MAJOR","cm:versionLabel":"1.0","cm:description":"descriptiontest"}}}
And with include options the response will look similar to this -
{"entry":{"isFile":true,"createdByUser":{"id":"admin","displayName":"Administrator"},"modifiedAt":"2020-12-16T00:01:56.615+0000","association":{"isPrimary":true,"assocType":"cm:contains"},"nodeType":"cm:content","content":{"mimeType":"application/pdf","mimeTypeName":"Adobe PDF Document","sizeInBytes":8037,"encoding":"UTF-8"},"parentId":"c250f9c5-d3f9-4c9e-83c6-2d239f8c2237","aspectNames":["cm:versionable","cm:titled","cm:auditable","cm:taggable","cm:author"],"createdAt":"2020-12-13T16:48:27.600+0000","path":{"name":"/Company Home/Sites/site1/documentLibrary/Employee/Test","isComplete":true,"elements":[{"id":"3ac0f350-a3e0-4da4-8dfa-c8e74553b024","name":"Company Home","nodeType":"cm:folder","aspectNames":["cm:titled","cm:auditable","app:uifacets"]},{"id":"15d878c2-e880-4a3f-ac00-60596ba2dcd1","name":"Sites","nodeType":"st:sites","aspectNames":["cm:titled","cm:auditable","app:uifacets"]},{"id":"46c2a6b1-2839-4b25-ac5d-c7dd874aea1e","name":"site1","nodeType":"st:site","aspectNames":["cm:tagscope","cm:titled","cm:auditable"]},{"id":"e8bc3bfe-7b41-416e-aa6a-9ee1b4fc9779","name":"documentLibrary","nodeType":"cm:folder","aspectNames":["cm:tagscope","st:siteContainer","cm:ownable","cm:titled","cm:auditable"]},{"id":"d5027ba7-874c-4996-bcde-923c68ec4c5b","name":"Employee","nodeType":"cm:folder","aspectNames":["cm:titled","cm:auditable"]},{"id":"c250f9c5-d3f9-4c9e-83c6-2d239f8c2237","name":"Test","nodeType":"cm:folder","aspectNames":["cm:titled","cm:auditable"]}]},"isFolder":false,"permissions":{"inherited":[{"authorityId":"GROUP_EVERYONE","name":"SiteConsumer","accessStatus":"ALLOWED"},{"authorityId":"GROUP_EVERYONE","name":"ReadPermissions","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteConsumer","name":"SiteConsumer","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteManager","name":"SiteManager","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteCollaborator","name":"SiteCollaborator","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteContributor","name":"SiteContributor","accessStatus":"ALLOWED"}],"settable":["Contributor","Collaborator","Coordinator","Editor","Consumer"],"isInheritanceEnabled":true},"modifiedByUser":{"id":"admin","displayName":"Administrator"},"name":"fileName","id":"dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb","properties":{"cm:title":"titletest","cm:versionType":"MAJOR","cm:versionLabel":"1.0","cm:description":"descriptiontest"}}}
Disclaimer: I am using Alfresco 6.2 Community Edition. But as per documentation (public rest-api link) it says:
Note: this endpoint is available in Alfresco 5.2 and newer versions.

Resources