-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.tpl
73 lines (50 loc) · 1.41 KB
/
template.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
___TERMS_OF_SERVICE___
By creating or modifying this file you agree to Google Tag Manager's Community
Template Gallery Developer Terms of Service available at
https://developers.google.com/tag-manager/gallery-tos (or such other URL as
Google may provide), as modified from time to time.
___INFO___
{
"type": "MACRO",
"id": "cvt_temp_public_id",
"version": 1,
"securityGroups": [],
"displayName": "SEO monitoring title tag",
"categories": ["MARKETING", "ANALYTICS"],
"description": "Checks if title is above 60 characters. Keep titles under 60 characters and most of them will be displayed properly in the SERPs.",
"containerContexts": [
"WEB"
]
}
___TEMPLATE_PARAMETERS___
[]
___SANDBOXED_JS_FOR_WEB_TEMPLATE___
const readTitle = require('readTitle');
if (readTitle().length >= 60) {
return "Title tag is too long: " + readTitle().length + " characters";
} else {
return "Title tag length is ok";
}
___WEB_PERMISSIONS___
[
{
"instance": {
"key": {
"publicId": "read_title",
"versionId": "1"
},
"param": []
},
"isRequired": true
}
]
___TESTS___
scenarios:
- name: Variable result is not undefined
code: |-
// Call runCode to run the template's code.
let variableResult = runCode();
// Verify that the variable returns a result.
assertThat(variableResult).isNotEqualTo(undefined);
___NOTES___
Created on 5.10.2021, 09:49:18